And setting source should be tons faster than looping.

On 11/4/13 8:04 AM, "Maurice Amsellem" <maurice.amsel...@systar.com> wrote:

>Yes.   EventKind="reset"
>
>-----Message d'origine-----
>De : mark goldin [mailto:markzolo...@gmail.com]
>Envoyé : lundi 4 novembre 2013 16:39
>À : users
>Objet : Re: Copying ArrayCollections
>
>By RESET do you mean collectionChange event?
>
>
>On Mon, Nov 4, 2013 at 8:12 AM, Maurice Amsellem <
>maurice.amsel...@systar.com> wrote:
>
>> Personally, I am using a third variant:
>>
>> Target.source = newSource.toArray();
>>
>> It has the advantage or not breaking any existing collection
>> listeners, and will generate only one RESET event.
>>
>> Maurice
>>
>> -----Message d'origine-----
>> De : mark goldin [mailto:markzolo...@gmail.com] Envoyé : lundi 4
>> novembre 2013 12:46 À : users Objet : Copying ArrayCollections
>>
>> Is the following code functionally identical:
>>
>> target.removeAll();
>> for each (var item:* in source)
>> {
>> target.addItem(item);
>> }
>>
>> and this:
>> target = new ArrayCollection(source.toArray());
>>
>> Thanks
>>

Reply via email to