Beispiel #1
0
        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());
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }