Raised This Month: $ Target: $400
 0% 

[question] array of booleans or integer?(optimization)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-15-2010 , 19:53   Re: [question] array of booleans or integer?(optimization)
Reply With Quote #6

IMO, it would be easier to manage and code using what I posted above where each player their own bitfield of options versus having a variable of each flag and setting a player id bit to 1/0.

@fysiks, there was a discussion somewhere regarding the speed of id-1, id % 31, and id & 31, id & 31 turned out to be the most efficient.
__________________

Last edited by Bugsy; 10-15-2010 at 19:57.
Bugsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode