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

Various - Use configOf command for faster lookup #8100

Merged
merged 2 commits into from
Feb 18, 2021
Merged

Conversation

PabstMirror
Copy link
Contributor

@PabstMirror PabstMirror commented Feb 9, 2021

A tiny bit faster

  • Look at uses of CBA_fnc_getObjectConfig

selfnote:

configFile >> "CfgVehicles" >> \(typeOf _(\w*\d*)\)
configOf _$1

@PabstMirror PabstMirror added the kind/optimization Release Notes: **IMPROVED:** label Feb 9, 2021
@PabstMirror PabstMirror added this to the 3.13.6 milestone Feb 9, 2021
private _cfgWeapons = configFile >> "CfgWeapons";

if (_toggle) then {
{
if (hmd _x isEqualTo "") then {
// Get NVG item and helmet from unit config
private _linkedItems = getArray (_cfgVehicles >> typeOf _x >> "linkedItems");
private _linkedItems = getArray (configOf _x >> "linkedItems");
private _nvgItem = _linkedItems select {_x isKindOf ["NVGoggles", _cfgWeapons]};
private _nvgHelmet = _linkedItems select {!(getArray (_cfgWeapons >> _x >> "subItems") isEqualTo [])};
Copy link
Contributor

@Drofseh Drofseh Feb 14, 2021

Choose a reason for hiding this comment

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

Here too?
Oh, no, no typeOf to replace.

@PabstMirror PabstMirror merged commit e8693c8 into master Feb 18, 2021
@PabstMirror PabstMirror deleted the configOf branch February 18, 2021 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/optimization Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants