Just a tip
#1

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?
Reply
#2

Obviously not. The size shouldn't increase that much from simply using cases. There is obviously more to it.
Reply
#3

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.
Reply
#4

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.
Reply
#5

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:

pawn Код:
case 45001 .. 65000:
Reply
#6

Convert that to if statement, like so:
pawn Код:
if (45000 < var < 65001)
{
}
else if (65000 < var < 85001)
{
}
More efficient.
Reply
#7

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
Reply
#8

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
I need it from 45000 to a max of 65001
Okay, I just posted an example.
Reply
#9

Quote:
Originally Posted by YJIET
Посмотреть сообщение
Okay, I just posted an example.
Yes, thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)