mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
Mark hash dirty
This commit is contained in:
parent
a8a62b0923
commit
39e28159bb
2 changed files with 6 additions and 0 deletions
|
@ -30,12 +30,14 @@ func (d *diffContainer) PrecalculatedDiff() Diff {
|
|||
func (d *diffContainer) Set(elements ...Element) {
|
||||
d.initial.mu.Lock()
|
||||
defer d.initial.mu.Unlock()
|
||||
defer d.initial.markHashDirty()
|
||||
d.precalculated.Set(elements...)
|
||||
}
|
||||
|
||||
func (d *diffContainer) RemoveId(id string) error {
|
||||
d.initial.mu.Lock()
|
||||
defer d.initial.mu.Unlock()
|
||||
defer d.initial.markHashDirty()
|
||||
return d.precalculated.RemoveId(id)
|
||||
}
|
||||
|
||||
|
|
|
@ -251,6 +251,10 @@ func (d *olddiff) Diff(ctx context.Context, dl Remote) (newIds, changedIds, remo
|
|||
return dctx.newIds, dctx.changedIds, dctx.removedIds, nil
|
||||
}
|
||||
|
||||
func (d *olddiff) markHashDirty() {
|
||||
d.hashIsDirty.Store(true)
|
||||
}
|
||||
|
||||
func (d *olddiff) compareResults(dctx *diffCtx, r Range, myRes, otherRes RangeResult) {
|
||||
// both hash equals - do nothing
|
||||
if bytes.Equal(myRes.Hash, otherRes.Hash) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue