This seems to be more efficient, but needs to be evaluated.
Change-Id: Ia8ddc618b7b98a82ad51d97c349d035793386562
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
63dd7f36f6f23ce6e35cd0027ea042147fec641c)
*/
if (!version.equals(subtreeVersion)) {
final Map<PathArgument, TreeNode> newChildren = MapAdaptor.getDefaultInstance().optimize(children);
- final int dataSize = getData().body().size();
+ final int dataSize = getData().size();
final int childrenSize = newChildren.size();
if (dataSize != childrenSize) {
verify(dataSize > childrenSize, "Detected %s modified children, data has only %s",
@Override
public MutableTreeNode mutable() {
final Map<PathArgument, TreeNode> snapshot = snapshotChildren();
- if (snapshot.size() == castData().body().size()) {
+ if (snapshot.size() == castData().size()) {
return new MaterializedMutableContainerNode(this, snapshot);
}
return new LazyMutableContainerNode(this, snapshot);