Skip to content

Commit

Permalink
index updates have to be aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Sep 5, 2024
1 parent 75b00cc commit b657a57
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 @@ -107,12 +107,12 @@ class HyperDB {
const idx = collection.indexes[i]
const prevKey = prevDoc && idx.encodeKey(prevDoc)
const nextKey = idx.encodeKey(doc)

if (prevKey !== null && b4a.equals(nextKey, prevKey)) continue

const ups = []

u.indexes.push(ups)

if (prevKey !== null && b4a.equals(nextKey, prevKey)) continue

if (prevKey !== null) ups.push({ key: prevKey, del: true })
if (nextKey !== null) ups.push({ key: nextKey, del: false })
}
Expand Down

0 comments on commit b657a57

Please sign in to comment.