Skip to content

Commit

Permalink
Feedback: optimize _maybeWant with rcl
Browse files Browse the repository at this point in the history
  • Loading branch information
LuKks committed Jul 6, 2023
1 parent fcd9812 commit bc38a38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/replicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,8 @@ class Peer {
}

_maybeWant (start, length = 1) {
if (start + length < this.remoteContiguousLength) return

let i = Math.floor(start / DEFAULT_SEGMENT_SIZE)
const n = Math.ceil((start + length) / DEFAULT_SEGMENT_SIZE)

Expand Down

0 comments on commit bc38a38

Please sign in to comment.