hypercore 11.0.8 → 11.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/remote-bitfield.js +3 -2
- package/package.json +1 -1
package/lib/remote-bitfield.js
CHANGED
|
@@ -203,14 +203,15 @@ module.exports = class RemoteBitfield {
|
|
|
203
203
|
p = this._pages.set(i, new RemoteBitfieldPage(i, new Uint32Array(WORDS_PER_PAGE), s))
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
const
|
|
206
|
+
const offset = p.index * BITS_PER_PAGE
|
|
207
|
+
const last = Math.min(end - offset, BITS_PER_PAGE)
|
|
207
208
|
const range = last - j
|
|
208
209
|
|
|
209
210
|
if (p) p.setRange(j, last, val)
|
|
210
211
|
|
|
211
212
|
j = 0
|
|
212
213
|
i++
|
|
213
|
-
|
|
214
|
+
start += range
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
217
|
|