From 4ff1ece2e4bc49443f02c3508a5d89493f4a047e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Junod?= Date: Fri, 4 Dec 2009 08:07:53 +0000 Subject: [PATCH] Use array.indexOf native function when available. p=arno, r=ahocevar git-svn-id: http://svn.openlayers.org/trunk/openlayers@9859 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Util.js | 16 ++++++++++------ tests/Util.html | 8 ++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index fcf9bb9e55..6260212cc2 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -147,17 +147,21 @@ OpenLayers.Util.clearArray = function(array) { * obj - {Object} * * Returns: - * {Integer} The index at, which the object was found in the array. + * {Integer} The index at, which the first object was found in the array. * If not found, returns -1. */ OpenLayers.Util.indexOf = function(array, obj) { - - for(var i=0, len=array.length; i