public void NonEmptyTree_areNotFrozen_after_creating_or_changing() { // non empty tree are not frozen after creating SigoAssert.False(tree.IsFrozen()); // not frozen after changing tree = tree.Freeze().Set1("v", Sigo.From("v+")); SigoAssert.False(tree.IsFrozen()); // leafs and elements are frozen always frozen SigoAssert.True(leaf.IsFrozen()); SigoAssert.True(e3.IsFrozen()); }
private static ISigo Select(ISigo r, ISigo a, ISigo b) { if (a.IsFrozen() && Sigo.Equals(r, a)) { return(a); } if (b.IsFrozen() && Sigo.Equals(r, b)) { return(b); } return(r); }
public static ISigo Clone(ISigo a) { if (a.IsFrozen()) { return(a); } var ret = Sigo.Create(a.Flags & 7); foreach (var e in a) { ret = ret.Set1(e.Key, Clone(e.Value)); } return(ret); }