SA-MP Forums Archive
More optimized code! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: More optimized code! (/showthread.php?tid=392652)



More optimized code! - Glint - 15.11.2012

Hello guys i found this on the first page of "Useful Functions"

pawn Код:
#define DisableBadword(%1) for(new i=0; i<strlen(text); i++) if(strfind(text[i], %1, true) == 0) for(new a=0; a<256; a++) if (a >= i && a < i+strlen(%1)) text[a]='*'
My question is, are there any more optimized versions of this specific code ?


Re: More optimized code! - Glint - 15.11.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
Is that code being particularly slow for you and acting as the cause of bottlenecks in your otherwise lag-free server?
To be honest Y i didn't even test the code or did anything with it i was just adding that function and thought of asking here are there any problems with it, i mean can we optimize it more, as i said i didn't test it.