Skip to content

Commit

Permalink
General - Use findAny where possible (acemod#10292)
Browse files Browse the repository at this point in the history
Use `findAny`
  • Loading branch information
johnb432 authored Sep 5, 2024
1 parent 391a81c commit e23a26d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/medical_treatment/functions/fnc_hasItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private _fnc_checkItems = {
_unitItems append (itemCargo _unitVehicle);
_unitItems append (magazineCargo _unitVehicle);
};
_items findIf {_x in _unitItems} != -1
_items findAny _unitItems != -1
};

_medic call _fnc_checkItems || {GVAR(allowSharedEquipment) != 2 && {_patient call _fnc_checkItems}}
2 changes: 1 addition & 1 deletion addons/trenches/functions/fnc_hasEntrenchingTool.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ private _uniqueItems = _unit call EFUNC(common,uniqueItems);
_uniqueItems append weapons _unit;
_uniqueItems pushBack backpack _unit;

GVAR(entrenchingTools) findIf {_x in _uniqueItems} != -1 // return
GVAR(entrenchingTools) findAny _uniqueItems != -1 // return
2 changes: 1 addition & 1 deletion addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ if (_sideKeyName in _items) exitWith {true};
private _customKeys = _veh getVariable [QGVAR(customKeys), []];
private _magazines = magazinesDetail _unit;

(_customKeys findIf {_x in _magazines}) != -1
_customKeys findAny _magazines != -1

0 comments on commit e23a26d

Please sign in to comment.