Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function createUnionMap (keyEncoding, valueEncoding) {

if (!haveSameNewValue) {
// apply-entry wins, but the previous state (.right) is not the value
// at the last indexedLength, since a diffEntry to undo exists for the same key
// at the last signedLength, since a diffEntry to undo exists for the same key
// So we yield that to-undo diffEntry's final state as previous state for this change
return filterSameValue({
left: decode(applyDiffEntry.left),
Expand Down Expand Up @@ -85,13 +85,13 @@ class BeeDiffStream extends Union {
// Binary encodings for easier comparison later
opts = { ...opts, gt, gte, lt, lte, valueEncoding: 'binary', keyEncoding: 'binary' }

if (leftSnapshot.core.indexedLength === undefined) {
throw new Error('Incompatible Hypercore version--must have indexedLength property')
if (leftSnapshot.core.signedLength === undefined) {
throw new Error('Incompatible Hypercore version--must have signedLength property')
}

// We know that everything indexed in both snapshots is shared
const sharedIndexedL = Math.min(
leftSnapshot.core.indexedLength, rightSnapshot.core.indexedLength
leftSnapshot.core.signedLength, rightSnapshot.core.signedLength
)

// TODO: consider optimisation for case where the version of both streams
Expand Down