llvm.org GIT mirror llvm / 7928376
Speed up simple insertions into an unbranched tree by not creating an iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120232 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 9 years ago
1 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
11271127 /// It is assumed that no key in the interval is mapped to another value, but
11281128 /// overlapping intervals already mapped to y will be coalesced.
11291129 void insert(KeyT a, KeyT b, ValT y) {
1130 find(a).insert(a, b, y);
1130 if (branched() || rootSize == RootLeaf::Capacity)
1131 return find(a).insert(a, b, y);
1132
1133 // Easy insert into root leaf.
1134 unsigned p = rootLeaf().findFrom(0, rootSize, a);
1135 rootSize = rootLeaf().insertFrom(p, rootSize, a, b, y).second;
11311136 }
11321137
11331138 /// clear - Remove all entries.