minor changes to cmp functions, more consistent now

This commit is contained in:
Sami Samhuri 2011-06-05 18:09:51 -07:00
parent f956cefaab
commit 22a5e5854b
2 changed files with 4 additions and 4 deletions

View file

@ -14,9 +14,9 @@ exports.extendNative = function() {
extend(module.exports, ObjectExt); extend(module.exports, ObjectExt);
function cmp(a, b) { function cmp(a, b) {
if (a === b) return 0;
if (a < b) return -1;
if (a > b) return 1; if (a > b) return 1;
if (a < b) return -1;
if (a === b) return 0;
throw new Error('cannot effectively compare values'); throw new Error('cannot effectively compare values');
} }

View file

@ -15,7 +15,7 @@ exports.extendNative = function() {
require('./object').extend(exports, StringExt); require('./object').extend(exports, StringExt);
function cmp(a, b) { function cmp(a, b) {
if (a === b) return 0; if (a > b) return 1;
if (a < b) return -1; if (a < b) return -1;
return 1; // a > b return 0;
} }