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

Strings cleanup #770

Merged
merged 5 commits into from
Nov 18, 2017
Merged

Strings cleanup #770

merged 5 commits into from
Nov 18, 2017

Conversation

Neviothr
Copy link
Contributor

When merged this pull request will:

  • do some clean up in strings component.

@@ -35,31 +35,26 @@ SCRIPT(find);

// ----------------------------------------------------------------------------

params ["_haystack","_needle", ["_initialIndex",0]];
params ["_haystack","_needle", ["_initialIndex", 0]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...stack", "_needle...

@@ -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]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, DEFAULT_SEPARATE...

@@ -27,10 +27,13 @@ Author:
SCRIPT(substring);

// ----------------------------------------------------------------------------
params["_string","_startIndex","_endIndex"];
params["_string", "_startIndex", "_endIndex"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params ["_str...

@@ -88,4 +88,4 @@ if (_separateThousands) then { // add localized thousands seperator "1,000"

if (_isNegative) then {_return = "-" + _return;}; // re-add negative sign

_return
_return
Copy link
Contributor

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?

Copy link
Member

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.

@Neviothr
Copy link
Contributor Author

What the...

@Neviothr
Copy link
Contributor Author

Git fails to see the newline 😕
https://i.imgur.com/hmBQY2N.png

@Dystopian
Copy link
Contributor

there were more than one file :)

-1
};
if (typeName _haystack != "STRING") exitWith {-1};
if (typeName _needle != "STRING") exitWith {-1};
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@commy2 commy2 added the Cleanup label Nov 3, 2017
@commy2 commy2 added this to the 3.5 milestone Nov 3, 2017
if(_initialIndex > (count _haystack) ) exitWith {
-1
};
if (_initialIndex > (count _haystack)) exitWith {-1};
Copy link
Contributor

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

@commy2 commy2 self-assigned this Nov 4, 2017
@commy2 commy2 merged commit 815dac2 into CBATeam:master Nov 18, 2017
@Neviothr Neviothr deleted the nev-strings-cleanup branch November 19, 2017 09:41
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.

5 participants