Skip to content

Commit

Permalink
Shuffle - Use faster deleteAt
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Dec 12, 2015
1 parent 1251987 commit 968e477
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions addons/arrays/fnc_shuffle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ _tempArray = if (count _this != 1) then {

for "_size" from (count _tempArray) to 1 step -1 do {
_indexToRemove = floor random _size;
PUSH(_shuffledArray,_tempArray select _indexToRemove);
_tempArray = [_tempArray, _indexToRemove] call BIS_fnc_removeIndex;
_shuffledArray pushBack (_tempArray deleteAt _indexToRemove);
};

_shuffledArray

0 comments on commit 968e477

Please sign in to comment.