mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-07 21:47:02 +09:00
fix
This commit is contained in:
parent
4de1398b7b
commit
ebb12e2fc7
1 changed files with 4 additions and 2 deletions
|
@ -396,8 +396,9 @@ func (d *diff) compareElementsEqual(dctx *diffCtx, my, other []Element) {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
otherMap := toMap(other)
|
||||||
for _, el := range my {
|
for _, el := range my {
|
||||||
has, eq := find(toMap(other), el)
|
has, eq := find(otherMap, el)
|
||||||
if !has {
|
if !has {
|
||||||
dctx.removedIds = append(dctx.removedIds, el.Id)
|
dctx.removedIds = append(dctx.removedIds, el.Id)
|
||||||
continue
|
continue
|
||||||
|
@ -408,8 +409,9 @@ func (d *diff) compareElementsEqual(dctx *diffCtx, my, other []Element) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myMap := toMap(my)
|
||||||
for _, el := range other {
|
for _, el := range other {
|
||||||
if has, _ := find(toMap(my), el); !has {
|
if has, _ := find(myMap, el); !has {
|
||||||
dctx.newIds = append(dctx.newIds, el.Id)
|
dctx.newIds = append(dctx.newIds, el.Id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue