Skip to content

Commit

Permalink
Merge pull request #548 from YousefED/fix/equalDeleteSets
Browse files Browse the repository at this point in the history
fix equalDeleteSets
  • Loading branch information
dmonad committed Jun 22, 2023
2 parents 65c4d40 + eda0859 commit 83b7c68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/DeleteSet.js
Expand Up @@ -335,7 +335,7 @@ export const readAndApplyDeleteSet = (decoder, transaction, store) => {
*/
export const equalDeleteSets = (ds1, ds2) => {
if (ds1.clients.size !== ds2.clients.size) return false
ds1.clients.forEach((deleteItems1, client) => {
for (const [client, deleteItems1] of ds1.clients.entries()) {
const deleteItems2 = /** @type {Array<import('../internals.js').DeleteItem>} */ (ds2.clients.get(client))
if (deleteItems2 === undefined || deleteItems1.length !== deleteItems2.length) return false
for (let i = 0; i < deleteItems1.length; i++) {
Expand All @@ -345,6 +345,6 @@ export const equalDeleteSets = (ds1, ds2) => {
return false
}
}
})
}
return true
}

0 comments on commit 83b7c68

Please sign in to comment.