Yeah! Only when ArrayUtil.getItemIndex() is able to find Objects inside nested 
arrays it will serve a purpose

Regards,
Arul

  ----- Original Message ----- 
  From: Troy Gilbert 
  To: [email protected] 
  Sent: Saturday, March 17, 2007 12:19 AM
  Subject: Re: [flexcoders] Wondering why ArrayUtil.getItemIndex() loops 
through Array Items instead of using Array.indexOf()


  And furthermore, what's the point of having that method? I would assume the 
point of a util function would be to aggregate several common steps, but it 
seems to me like they just changed name?

  Array.indexOf() == ArrayUtil.getItemIndex() (functionality-wise)

  So, what's the deal?

  Troy.




  On 16 Mar 2007 07:39:31 -0700, Arul < [EMAIL PROTECTED]> wrote:
    Looking at mx.utils.ArrayUtil class I'm wondering why it does not make use 
    of native method Array.indexOf for getItemIndex() method. I'm thinking
    native method should be faster

    public static function getItemIndex(item:Object, source:Array):int
        {
            var n:int = source.length ;
            for (var i:int = 0; i < n; i++)
            {
                if (source[i] === item)
                    return i;
            }

            return -1;
        }



    Is there a specific reason? If so, I would like to know 

    Thanks & Regards,
    Arul





    --
    Flexcoders Mailing List
    FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
    Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
    Yahoo! Groups Links 







   

Reply via email to