Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed incorrect substring usage in find #421

Merged
merged 2 commits into from
Jul 11, 2016
Merged

Conversation

nilsms
Copy link
Contributor

@nilsms nilsms commented Jul 11, 2016

When using substring in fnc_find with initialIndex, the substring should be from the index and to the end of the haystack.
The original code would return -1 for the example:
_result = ["frog-headed fish", "f", 5] call CBA_fnc_find;
And not 12 as shown in the example.

When using substring in fnc_find with initialIndex, the substring should be from the index and to the end of the haystack.
The original code would return -1 for the example:
_result = ["frog-headed fish", "f", 5] call CBA_fnc_find;
And not 12 as shown in the example.
@Killswitch00
Copy link
Contributor

Killswitch00 commented Jul 11, 2016

Please update the function tests as well, with the sample code from the function header (strings\test_strings.sqf, where CBA_fnc_find is tested):

_pos = ["frog-headed fish", "f", 5] call CBA_fnc_find;
TEST_OP(_pos,==,12,_fn);

@Killswitch00 Killswitch00 added this to the 2.5 milestone Jul 11, 2016
@Killswitch00
Copy link
Contributor

Thanks. Merging.

@Killswitch00 Killswitch00 merged commit ff71702 into CBATeam:master Jul 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants