Skip to content

Commit a02fa22

Browse files
yanglbmeactions-user
authored andcommitted
style: prettify code
1 parent d0f5a31 commit a02fa22

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed
+14-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Definition for isBadVersion()
3-
*
3+
*
44
* @param {integer} version number
55
* @return {boolean} whether the version is bad
66
* isBadVersion = function(version) {
@@ -12,21 +12,22 @@
1212
* @param {function} isBadVersion()
1313
* @return {function}
1414
*/
15-
var solution = function(isBadVersion) {
15+
var solution = function (isBadVersion) {
1616
/**
1717
* @param {integer} n Total versions
1818
* @return {integer} The first bad version
1919
*/
20-
return function(n) {
21-
let low = 1, high = n;
22-
while (low < high) {
23-
const mid = low + ((high - low) >> 1);
24-
if (isBadVersion(mid)) {
25-
high = mid;
26-
} else {
27-
low = mid + 1;
28-
}
20+
return function (n) {
21+
let low = 1,
22+
high = n;
23+
while (low < high) {
24+
const mid = low + ((high - low) >> 1);
25+
if (isBadVersion(mid)) {
26+
high = mid;
27+
} else {
28+
low = mid + 1;
2929
}
30-
return low;
30+
}
31+
return low;
3132
};
32-
};
33+
};

0 commit comments

Comments
 (0)