Posts: 3,351
Threads: 780
Joined: Jan 2010
Hello, im making a Tax system for my server and i have a problem.
I use cases (20 of them) for my tax system and Pawno it takes 2 minutes to compile, also the .amx size is big (1,50mb).
Removing the cases, it takes 5 seconds to compile and the .amx size is 500kb.
My question is: Is normal?
Posts: 298
Threads: 24
Joined: Oct 2012
Reputation:
0
Obviously not. The size shouldn't increase that much from simply using cases. There is obviously more to it.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by zDivine
Obviously not. The size shouldn't increase that much from simply using cases. There is obviously more to it.
|
That's strange, because if i remove the cases, it takes less time to compile.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by YJIET
Size actually increases if you use switch statement when it would be more appropriate to use if statement, for example:
pawn Код:
switch (var) { case 1 .. 10000: }
That's bad.
|
That's my problem. The tax system im developing is abit complex, is based on kills, deaths, last average ping, admin actions and more.
Last case is:
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by YJIET
Convert that to if statement, like so:
pawn Код:
if (45000 < var < 65001) { } else if (65000 < var < 85001) { }
More efficient.
|
I need it from 45000 to a max of 65001
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by YJIET
Okay, I just posted an example.
|
Yes, thank you