remove useless or duplicate functions from Util.js -- no more: Array prepend() append() -- use push() and unshift(). clear() and indexOf() both removed as they are duplicated in Prototype.js -- all instances replaced and tests updated.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1136 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-08-09 03:31:06 +00:00
parent f2a3cf9348
commit 51ac2b4acf
10 changed files with 22 additions and 62 deletions
-30
View File
@@ -670,42 +670,12 @@ Array.prototype.clone = function() {
return clone;
};
/**
* @param {Object} item
*/
Array.prototype.prepend = function(item) {
this.splice(0, 0, item);
};
/**
* @param {Object} item
*/
Array.prototype.append = function(item){
this[this.length] = item;
};
/**
*/
Array.prototype.clear = function() {
this.length = 0;
};
/**
* @param {Object} element
*
* @returns The first index of the element in the array if found. Else returns -1
* @type int
*/
Array.prototype.indexOf = function(element) {
var index = -1;
for(var i=0; i < this.length; i++) {
if (this[i] == element) {
index = i;
break;
}
}
return index;
}
/** NOTE: Works only with integer values does *not* work with floats!
*