Jump to content
Sign in to follow this  
jwllorens

Simple question about "count" command

Recommended Posts



{
  if (_x isPlayer) exitWith {true};
  false
} count _thisList;


 

is generally faster than...

 




if (({_x isPlayer} count _thisList) > 0) then [{true},{false}];


 

assuming 

a: A player unit is in _thisList;

b: The player unit in _thisList is not the last element in the array.

 

Is this correct to assume?


Share this post


Link to post
Share on other sites

You can measure the performance yourself, no need to assume anything. However I doubt any of the given code will run.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×