Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 01356200CAF for ; Thu, 22 Jun 2017 10:06:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F4216160BE5; Thu, 22 Jun 2017 08:06:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 42D89160BE7 for ; Thu, 22 Jun 2017 10:06:18 +0200 (CEST) Received: (qmail 67468 invoked by uid 500); 22 Jun 2017 08:06:17 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 67460 invoked by uid 99); 22 Jun 2017 08:06:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2017 08:06:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 581C7DFA3C; Thu, 22 Jun 2017 08:06:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: harbs@apache.org To: commits@flex.apache.org Message-Id: <733b9321b2ad477eaf851ed3e7171edd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: [flex-asjs] [refs/heads/tlf] - Better optimization for getItemIndex() Date: Thu, 22 Jun 2017 08:06:17 +0000 (UTC) archived-at: Thu, 22 Jun 2017 08:06:19 -0000 Repository: flex-asjs Updated Branches: refs/heads/tlf 9cc57c4ed -> 99bf3f175 Better optimization for getItemIndex() Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/99bf3f17 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/99bf3f17 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/99bf3f17 Branch: refs/heads/tlf Commit: 99bf3f175c49a702ef011a73443a38bdb4f1eb18 Parents: 9cc57c4 Author: Harbs Authored: Thu Jun 22 11:06:12 2017 +0300 Committer: Harbs Committed: Thu Jun 22 11:06:12 2017 +0300 ---------------------------------------------------------------------- .../src/main/flex/org/apache/flex/collections/ArrayList.as | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/99bf3f17/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as b/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as index fe74932..72a61c0 100644 --- a/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as +++ b/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as @@ -207,12 +207,7 @@ package org.apache.flex.collections */ public function getItemIndex(item:Object):int { - for (var index:int=0; index < _source.length; index++) { - if (item == _source[index]) { - return index; - } - } - return -1; + return _source.indexOf(item); } /**