Skip to content

Commit

Permalink
Merge pull request #668 from Collaborne/pr/seek-simplify
Browse files Browse the repository at this point in the history
Simplify and speed up the SeekOffsets code
  • Loading branch information
Nevon authored Jun 1, 2020
2 parents ea873f6 + 98fe596 commit 4b7e79b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/consumer/seekOffsets.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ module.exports = class SeekOffsets extends Map {
return
}

const [key, offset] = Array.from(this.entries())
.reverse()
.pop()
const [key, offset] = this.entries().next().value
this.delete(key)
const [topic, partition] = key
return { topic, partition, offset }
Expand Down

0 comments on commit 4b7e79b

Please sign in to comment.