Strange Comment in PTR Code

by Atradies | 11/11/2007 00:19:29

Atradies

http://www.wowace.com/forums/index.php?topic=9767.msg156726#msg156726

to repeate it:


I noticed the following comment in UIPanelTemplates.lua from the current PTR source:


Q u o t e:

Declaring local variables in OnUpdate code makes the GC cry.



This is followed by a change that moves the local declaration of 5 variables out of then function ScrollingEdit_OnUpdate. These 5 variables are only assigned number values inside the function. I cannot imagine the GC would come into play here at all. Can anybody shed some light on this?

I'd hate if this was necessary to do. Local variables should be declared as close to their first use as possible in my opinion.

---------

Any Insight into this from anyone?

by Slouken | 11/11/2007 01:15:31

Slouken

What you don't see there is that one of the local variables that never made it to live was a locally declared table. :)

Blizzard Announcement Recent Blizzard Announcements

 



Loaded in 0.02374 seconds