Skip to content

Commit

Permalink
use seq index.count instead of index.tarr.length
Browse files Browse the repository at this point in the history
  • Loading branch information
staltz committed Mar 29, 2022
1 parent 19aee53 commit a786bc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,8 @@ module.exports = function (log, indexesPath) {
const seqs = []
opOffsets.sort((x, y) => x - y)
const opOffsetsLen = opOffsets.length
const { tarr } = indexes['seq']
for (let seq = 0, len = tarr.length; seq < len; ++seq) {
const { tarr, count } = indexes['seq']
for (let seq = 0; seq < count; ++seq) {
if (bsb.eq(opOffsets, tarr[seq]) !== -1) seqs.push(seq)
if (seqs.length === opOffsetsLen) break
}
Expand Down Expand Up @@ -1513,7 +1513,7 @@ module.exports = function (log, indexesPath) {
prevOffset = indexes['seq'].tarr[seq - 1]
}

if (prevOffset === 0 && seq === indexes['seq'].tarr.length) {
if (prevOffset === 0 && seq === indexes['seq'].count) {
// not found
seq = 1
}
Expand Down

0 comments on commit a786bc2

Please sign in to comment.