Skip to content

Commit 3901188

Browse files
committed
chore(sorting): clean up variables
1 parent e5bd4b7 commit 3901188

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/runtimes/04-merge-sort.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ const assert = require('assert');
1111
*/
1212
function merge(a = [], b = []) {
1313
const merged = [];
14-
let ai = 0;
15-
let bi = 0;
1614
// merge elements on a and b in asc order. Run-time O(a + b)
1715
for (let ai = 0, bi = 0; ai < a.length || bi < b.length;) {
18-
if(ai >= a.length || a[ai] > b[bi]) {
16+
if (ai >= a.length || a[ai] > b[bi]) {
1917
merged.push(b[bi++]);
2018
} else {
2119
merged.push(a[ai++]);

0 commit comments

Comments
 (0)