slow compile time
#11

Quote:
Originally Posted by wallee
Посмотреть сообщение
Sorry for bumping my old thread but i found the solution, the problem was my enum it was like this

Код:
enum ePlaData
{
	Float:plaHP,
	Float:plaArmz,
	plaKills = INVALID_SCORE,
	plaDeaths = INVALID_SCORE
};
I removed the red parts and the compile time went from 48 seconds to 2 seconds. Maybe someone who knows a bit more about pawn can tell me why? But even if i don't get a answer to that i'm still happy that i got this fixed :3
First you need to know that an enum is a list of constants, starting at 0 and going up by 1 by default if not otherwise specified
PHP код:
enum ePlaData
{
    
Float:plaHP// 0
    
Float:plaArmz// 1
    
plaKills INVALID_SCORE// normally 2 but overwritten with INVALID_SCORE
    
plaDeaths INVALID_SCORE // also overwritten with INVALID_SCORE
}; 
The enum name will be the next value after the last constant, in this case with the default rule ( += 1 ) ePlaData will hold (INVALID_SCORE + 1)

Using ePlaData like that would create a (INVALID_SCORE + 1) sized array each time
To assign default values use the array initializer
PHP код:
new array[ePlaData] = { 0.00.0INVALID_SCOREINVALID_SCORE }; 
Reread the enum part in pawn-lang.pdf (page 101)
Reply


Messages In This Thread
slow compile time - by wallee - 21.03.2017, 19:53
Re: slow compile time - by AndreiWow - 21.03.2017, 20:16
Re: slow compile time - by Stones - 21.03.2017, 20:17
Re: slow compile time - by iLearner - 21.03.2017, 22:12
Re: slow compile time - by CJ101 - 22.03.2017, 00:54
Re: slow compile time - by Runn3R - 22.03.2017, 12:19
Re: slow compile time - by JernejL - 23.03.2017, 07:54
Re: slow compile time - by Sithis - 23.03.2017, 08:25
Re: slow compile time - by ISmokezU - 23.03.2017, 11:20
Re: slow compile time - by wallee - 22.05.2017, 00:29
Re: slow compile time - by Nero_3D - 22.05.2017, 01:06
Re: slow compile time - by wallee - 22.05.2017, 13:27

Forum Jump:


Users browsing this thread: 4 Guest(s)