Most efficient way to empty a static array
What would be the most efficient way to empty (zero out) a static array of 256?
Surely there must be a way to do it without going through a loop? |
Re: Most efficient way to empty a static array
PHP Code:
Although, if you're printing something you could do something like this. PHP Code:
|
Re: Most efficient way to empty a static array
Oh it's an cell array, not a string.
|
Re: Most efficient way to empty a static array
Make your own extension to use memset. I doubt you really need this though.
|
Re: Most efficient way to empty a static array
Quote:
Quote:
|
Re: Most efficient way to empty a static array
Make up some value to use as a terminator and stop whatever you're doing when you come across it, and otherwise only initialize it once.... depending on what you're actually trying to do.
|
Re: Most efficient way to empty a static array
Quote:
This is called every frame. |
Re: Most efficient way to empty a static array
Well, then I suggest some kind of "stopper" (or variable with last valid index) like Chdata said.
Every array clearing will give you micro-freezes if you do it 64x per frame... |
Re: Most efficient way to empty a static array
Quote:
|
Re: Most efficient way to empty a static array
Quote:
I'd believe there is a plugin architecture problem here (but not enough information is given). |
All times are GMT -4. The time now is 04:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.