Beispiel #1
0
        public void RemoveFromBranchWithLeafKeyEqualToArgumentShouldStayAnotherChild()
        {
            IImmutableIntMap <string> left   = this.empty.Add(5, "hello");
            IImmutableIntMap <string> branch = left.Add(7, "there");

            IImmutableIntMap <string> node1 = branch.Remove(7);

            Assert.That(node1, Is.SameAs(left));

            IImmutableIntMap <string> node2 = branch.Remove(5);

            Assert.That(node2 is LeafNode <string>);
            Assert.That((node2 as LeafNode <string>).Key, Is.EqualTo(7));
            Assert.That((node2 as LeafNode <string>).Value, Is.EqualTo("there"));
        }
Beispiel #2
0
 public void AddCallOnThis(APC pc)
 {
     this.call_on_this_map = this.call_on_this_map.Add(pc.Block.Index, true);
 }
Beispiel #3
0
 public APCMap(Subroutine parent)
 {
     this.block_map        = new Dictionary <int, T> [parent.BlockCount];
     this.call_on_this_map = ImmutableIntMap <bool> .Empty();
 }
Beispiel #4
0
 private ImmutableMap(IImmutableIntMap <Sequence <Pair <K, V> > > map, int count, Sequence <K> keys)
 {
     this.keys              = keys;
     this.count             = count;
     this.immutable_int_map = map;
 }
Beispiel #5
0
 private ImmutableMap(IImmutableIntMap <LispList <Pair <K, V> > > map, int count, LispList <K> keys)
 {
     this.keys              = keys;
     this.count             = count;
     this.immutable_int_map = map;
 }
Beispiel #6
0
 private ImmutableIntKeyMap(IImmutableIntMap <Pair <K, V> > map, Func <K, int> converter)
 {
     this.immutable_int_map = map;
     this.keyConverter      = converter;
 }