HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Boolexpr Nulling

05-22-2008, 11:39 PM#1
PurgeandFire111
I don't really know what the problem with boolexpr nulling is. Can anyone explain it to me so I know for future reference?

TriggerRegisterAnyUnitEventBJ() uses null for the TriggerRegisterPlayerUnitEvent() function, so isn't that bad?

I just want to know the hazards and if it is more efficient to create a dummy True function and use that instead.

Or is it a leak?

Thanks to any repliers.

Btw: I searched but to no avail.
05-23-2008, 12:02 AM#2
grim001
It is not "boolexpr nulling," which would be the act of setting a local variable of type boolexpr to null.

It is "using a null filter/condition/boolexpr," which leaks a small amount of memory. Example:

Collapse JASS:
call GroupEnumUnitsInRange(g, x, y, r, null) //leaks

call GroupEnumUnitsInRange(g, x, y, r, Condition(function ReturnTrue)) //does not leak

Using null filters all the time becomes a major drag on performance if you use GroupEnum or similar functions a lot.
05-23-2008, 12:08 AM#3
PurgeandFire111
Yeah, I just wanted to keep the title short so I just chose that. ^^

Anyway, thanks for that. That helps a lot!
05-23-2008, 10:39 AM#4
Toadcop
Quote:
Using null filters all the time becomes a major drag on performance if you use GroupEnum or similar functions a lot.
i think it does create some "internal crash" or create every time a new boolexpr... + Enum is slow cause every unit "enumeration" == "TriggerEvaluate" for the boolexpr.