Rename defaultSort to numberSafeCompareFunction on ol.array
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user