Yeah, you're making a copy every time.  Shouldn't be a major performance
hit as it doesn't clone the column objects, it just makes a new array of
references to them.

 

If you have to get at them often, you might want to keep a reference to
the set you passed in, or cache the set from the DG unless you think it
is going to change often.

 

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of reflexactions
Sent: Friday, October 19, 2007 11:10 PM
To: [email protected]
Subject: [flexcomponents] DataGrid column access

 

I am working on a DataGrid subcomponent and have been accessing the 
columns array frequently, thinking nothing of it I just do something 
like:

... columns[i] ...

but then I saw that the columns getter function does a _columns.slice
(0).

Is the compiler smart enough to figure out i dont really want to clone 
the columns array every time I access it or am I really forcing it to 
copy the array?

tks

 

Reply via email to