-
Notifications
You must be signed in to change notification settings - Fork 149
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
Strings cleanup #770
Strings cleanup #770
Conversation
addons/strings/fnc_find.sqf
Outdated
@@ -35,31 +35,26 @@ SCRIPT(find); | |||
|
|||
// ---------------------------------------------------------------------------- | |||
|
|||
params ["_haystack","_needle", ["_initialIndex",0]]; | |||
params ["_haystack","_needle", ["_initialIndex", 0]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...stack", "_needle...
addons/strings/fnc_formatNumber.sqf
Outdated
@@ -64,7 +64,7 @@ Author: | |||
|
|||
SCRIPT(formatNumber); | |||
|
|||
params ["_number", ["_integerWidth",DEFAULT_INTEGER_WIDTH], ["_decimalPlaces",DEFAULT_DECIMAL_PLACES], ["_separateThousands",DEFAULT_SEPARATE_THOUSANDS]]; | |||
params ["_number", ["_integerWidth", DEFAULT_INTEGER_WIDTH], ["_decimalPlaces", DEFAULT_DECIMAL_PLACES], ["_separateThousands",DEFAULT_SEPARATE_THOUSANDS]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, DEFAULT_SEPARATE...
addons/strings/fnc_substring.sqf
Outdated
@@ -27,10 +27,13 @@ Author: | |||
SCRIPT(substring); | |||
|
|||
// ---------------------------------------------------------------------------- | |||
params["_string","_startIndex","_endIndex"]; | |||
params["_string", "_startIndex", "_endIndex"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params ["_str...
addons/strings/fnc_formatNumber.sqf
Outdated
@@ -88,4 +88,4 @@ if (_separateThousands) then { // add localized thousands seperator "1,000" | |||
|
|||
if (_isNegative) then {_return = "-" + _return;}; // re-add negative sign | |||
|
|||
_return | |||
_return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I the one who don't like this "last return" deleting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not just you, there should be an empty newline.
What the... |
Git fails to see the newline 😕 |
there were more than one file :) |
addons/strings/fnc_find.sqf
Outdated
-1 | ||
}; | ||
if (typeName _haystack != "STRING") exitWith {-1}; | ||
if (typeName _needle != "STRING") exitWith {-1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should change it to _var isEqualType ""
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Also, changed the private's and exitWith's positions. There's no point in assigning vars if the script might be terminated in the next line.
if(_initialIndex > (count _haystack) ) exitWith { | ||
-1 | ||
}; | ||
if (_initialIndex > (count _haystack)) exitWith {-1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder for me to fix this
When merged this pull request will: