-
Notifications
You must be signed in to change notification settings - Fork 116
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
More optimization #179
More optimization #179
Conversation
Conflicts: addons/main/XEH_preInit.sqf addons/sys_data/fnc_getPlayerRadioList.sqf addons/sys_server/fnc_masterIdTracker.sqf
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.
Some possible improvements.
_list pushBack ((GVAR(languages) select _x) select 0); | ||
} forEach ACRE_SPOKEN_LANGUAGES; | ||
_list | ||
ACRE_SPOKEN_LANGUAGES apply {((GVAR(languages) select _x) select 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.
No need for extra parenthesis and semi-colon.
ACRE_SPOKEN_LANGUAGES apply {(GVAR(languages) select _x) select 0};
@@ -16,11 +16,8 @@ | |||
#include "script_component.hpp" | |||
|
|||
private _list = _this; | |||
private _languageIds = []; | |||
private _languageIds = _list apply {([_x] call FUNC(getLanguageId))}; |
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.
What do you have with parenthesis! :P
private _languageIds = _list apply {[_x] call FUNC(getLanguageId)};
if (IS_ARRAY(_val)) then { | ||
_val = _val call FUNC(_arraySerialize); | ||
}; | ||
if (IS_HASH(_val)) then { | ||
_val = _val call FUNC(_hashSerialize); | ||
}; | ||
_vals pushBack _val; | ||
true; |
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.
Return value? No semi-colon.
|
||
private _isBaseClassRadio = false; | ||
|
||
if (HASH_HASKEY(GVAR(radioBaseClassCache),_this)) then { |
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.
if-exitwith
is faster than if-then-else
in this case, as it will only cache it on first call and then just needs the value.
@@ -18,7 +18,7 @@ | |||
|
|||
params ["_player", "_class", "_callback", ["_replacementId",""]]; | |||
|
|||
if (getNumber (configFile >> "CfgWeapons" >> _class >> "acre_hasUnique") == 0) then { | |||
if (!(_class call EFUNC(sys_radio,isBaseClassRadio))) then { |
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.
if !(_class call EFUNC(sys_radio,isBaseClassRadio)) then {
makes it easier to read IMO.
When merged this pull request will:
HASH_KEYS
macro is now fasterapply
andselect
. Including several serializers and deserializers are now faster.acre_sys_radio_fnc_isBaseClassRadio
andacre_sys_radio_fnc_isUniqueRadio
.