Rename defaultSort to numberSafeCompareFunction on ol.array

This commit is contained in:
Bart van den Eijnden
2015-12-16 13:40:05 +01:00
parent 88255fd776
commit 25e0053a13
10 changed files with 14 additions and 15 deletions

View File

@@ -38,13 +38,13 @@ ol.array.binaryFindNearest = function(arr, target) {
/**
* Default compare for array sort, will make sure number sort works okay.
* Compare function for array sort that is safe for numbers.
* @param {*} a The first object to be compared.
* @param {*} b The second object to be compared.
* @return {number} A negative number, zero, or a positive number as the first
* argument is less than, equal to, or greater than the second.
*/
ol.array.defaultCompare = function(a, b) {
ol.array.numberSafeCompareFunction = function(a, b) {
return a > b ? 1 : a < b ? -1 : 0;
};