Ejemplo n.º 1
0
            public static PersistentHashMap <K, V> FromTwoNodes(int s, uint h1, PersistentHashMap <K, V> n1, uint h2, PersistentHashMap <K, V> n2)
            {
                Debug.Assert(h1 != h2);
                Debug.Assert(s < TrieMaxShift);

                var b1 = Bit(h1, s);
                var b2 = Bit(h2, s);

                if (b1 < b2)
                {
                    return(new BitmapNodeN <K, V> (b1 | b2, new [] { n1, n2 }));
                }
                else if (b1 > b2)
                {
                    return(new BitmapNodeN <K, V> (b2 | b1, new [] { n2, n1 }));
                }
                else
                {
                    return(new BitmapNode1 <K, V> (b1, FromTwoNodes(s + TrieShift, h1, n1, h2, n2)));
                }
            }
Ejemplo n.º 2
0
 public BitmapNode1(uint b, PersistentHashMap <K, V> n)
 {
     Bitmap = b;
     Node   = n;
 }