incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmarga...@apache.org
Subject svn commit: r581462 - /incubator/xap/trunk/codebase/src/xap/util/ArrayHelper.js
Date Wed, 03 Oct 2007 01:21:29 GMT
Author: jmargaris
Date: Tue Oct  2 18:21:29 2007
New Revision: 581462

URL: http://svn.apache.org/viewvc?rev=581462&view=rev
Log:
efficiency changes

Modified:
    incubator/xap/trunk/codebase/src/xap/util/ArrayHelper.js

Modified: incubator/xap/trunk/codebase/src/xap/util/ArrayHelper.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/util/ArrayHelper.js?rev=581462&r1=581461&r2=581462&view=diff
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/util/ArrayHelper.js (original)
+++ incubator/xap/trunk/codebase/src/xap/util/ArrayHelper.js Tue Oct  2 18:21:29 2007
@@ -63,7 +63,8 @@
 	if (i<0){
 		return array;
 	}
-	return array.splice(i,1);
+	array.splice(i,1);
+	return array;
 }
 
 
@@ -87,7 +88,7 @@
  * @return {int} The index of the element, or -1 if not found.
  */ 
 xap.util.ArrayHelper.indexOf = function( array, element){
-	for (var i =0; i<array.length; i++){
+	for (var i =array.length-1; i>=0;i--){
 		if (array[i]==element){
 			return i;
 		}



Mime
View raw message