1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-07 21:47:02 +09:00
This commit is contained in:
Sergey Cherepanov 2025-06-02 16:12:28 +02:00
parent 4de1398b7b
commit ebb12e2fc7
No known key found for this signature in database
GPG key ID: 87F8EDE8FBDF637C

View file

@ -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)
} }
} }