We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce85dbb commit ded92d4Copy full SHA for ded92d4
1 file changed
index.js
@@ -20,13 +20,13 @@ export default class TinyQueue {
20
if (this.length === 0) return undefined;
21
22
const top = this.data[0];
23
- this.length--;
+ const bottom = this.data.pop();
24
25
- if (this.length > 0) {
26
- this.data[0] = this.data[this.length];
+ if (this.length > 1) {
+ this.data[0] = bottom;
27
this._down(0);
28
}
29
- this.data.pop();
+ this.length--;
30
31
return top;
32
0 commit comments