-
Notifications
You must be signed in to change notification settings - Fork 737
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
Attach - Optimize creating children actions #6345
Attach - Optimize creating children actions #6345
Conversation
_actions pushBack [_action, [], _target]; | ||
}; | ||
}; | ||
} forEach (items _player); |
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.
Oh FFS the old script iterated through items
?! wtf.
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.
Looks good to me
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.
One minor further improvement would be to move configFile >> "CfgMagazines"
and configFile >> "CfgWeapons"
into local variables outside the loop to spare a bit of runtime.
If you go that far, why not put these into globals at preInit? Guess that's something to consider for A4 if nothing significant changes. |
Because at that point the overhead of global var vs local var makes it not worth it anymore. |
|
* Optimize attach get children actions * Store CfgMagazines and CfgWeapons config lookups
When merged this pull request will:
CBA_fnc_uniqueUnitItems
andarrayIntersect
ace_attach_fnc_getChildrenAttachActions
->ace_attach_fnc_getChildrenActions