Skip to content

Commit 4e10c82

Browse files
guotiemourner
authored andcommitted
Remove redundant iteration (#5)
length >> 1 has no affect in _down. reduce loop by 1 time
1 parent 483f96f commit 4e10c82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function TinyQueue(data, compare) {
1111
this.compare = compare || defaultCompare;
1212

1313
if (this.length > 0) {
14-
for (var i = (this.length >> 1); i >= 0; i--) this._down(i);
14+
for (var i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);
1515
}
1616
}
1717

0 commit comments

Comments
 (0)