Is there a way to optimize this code?
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Why do you think it is slow? Why are you worried? Have you profiled your mode and found this to be a bottleneck?
I write the code just to see if it works. But it seems long because i create a lot of variables (i don't know if creating a lot of variables like above is needed?) and there're too much steps (strfind, strmid and strval) just to split one short string.

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
Sscanf plugin: https://sampforum.blast.hk/showthread.php?tid=570927
Download: https://github.com/maddinat0r/sscanf/releases

pawn Код:
new _money[] = "21.99", cash, coin;
sscanf(_money, "dd", cash, coin);
printf("money: %s, cash: %d, coin: %d", _money, cash, coin);
Thank you, this looks shorter (and less variables and may be faster?) than mine.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)