Skip to content

Commit

Permalink
Updating changelog with FixedDeque improvements by @jerome-benoit
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Feb 2, 2024
1 parent 608ec41 commit 9119409
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 0.39.8 (provisional)

* Fixing `Float64Vector` TS exports (@atombrenner).
* Improving performance of `FixedDeque` `#.push` & `#.pop` methods (@jerome-benoit).

## 0.39.7

Expand Down
2 changes: 2 additions & 0 deletions fixed-deque.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ FixedDeque.prototype.push = function(item) {
throw new Error('mnemonist/fixed-deque.push: deque capacity (' + this.capacity + ') exceeded!');

var index = this.start + this.size;

if (index >= this.capacity)
index -= this.capacity;

Expand Down Expand Up @@ -88,6 +89,7 @@ FixedDeque.prototype.pop = function() {
return;

var index = this.start + this.size - 1;

if (index > this.capacity)
index -= this.capacity;

Expand Down

0 comments on commit 9119409

Please sign in to comment.