Skip to content

Commit

Permalink
fixes merging cache
Browse files Browse the repository at this point in the history
  • Loading branch information
rbellens committed Oct 7, 2020
1 parent 09fe563 commit 4d9b90f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/snapshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ abstract class Snapshot implements DeepImmutable {
var snapshot = Snapshot.fromJson(newContent, decoder: _decoder);

if (value is Snapshot && value._decoder == _decoder) {
var parent = child(pointer.parent.toString());
var parent = snapshot.child(pointer.parent.toString());
(parent as _SnapshotImpl)._childrenCache[pointer.segments.last] = value;
}
return set(snapshot);
Expand Down Expand Up @@ -282,7 +282,8 @@ class _SnapshotImpl extends Snapshot {
newValue._childrenCache[k] =
_childrenCache[k].set(newValue._childrenCache[k]);
} else {
newValue._childrenCache[k] = _childrenCache[k];
newValue._childrenCache[k] =
_childrenCache[k].set(newValue._directChild(k));
}
}

Expand Down

0 comments on commit 4d9b90f

Please sign in to comment.