format: prettify entire project
This commit is contained in:
16
node_modules/source-map/lib/binary-search.js
generated
vendored
16
node_modules/source-map/lib/binary-search.js
generated
vendored
@ -36,8 +36,7 @@ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
||||
if (cmp === 0) {
|
||||
// Found the element we are looking for.
|
||||
return mid;
|
||||
}
|
||||
else if (cmp > 0) {
|
||||
} else if (cmp > 0) {
|
||||
// Our needle is greater than aHaystack[mid].
|
||||
if (aHigh - mid > 1) {
|
||||
// The element is in the upper half.
|
||||
@ -51,8 +50,7 @@ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
||||
} else {
|
||||
return mid;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Our needle is less than aHaystack[mid].
|
||||
if (mid - aLow > 1) {
|
||||
// The element is in the lower half.
|
||||
@ -91,8 +89,14 @@ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
|
||||
aCompare, aBias || exports.GREATEST_LOWER_BOUND);
|
||||
var index = recursiveSearch(
|
||||
-1,
|
||||
aHaystack.length,
|
||||
aNeedle,
|
||||
aHaystack,
|
||||
aCompare,
|
||||
aBias || exports.GREATEST_LOWER_BOUND
|
||||
);
|
||||
if (index < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user