mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Speed up simple insertions into an unbranched tree by not creating an iterator.
llvm-svn: 120232
This commit is contained in:
parent
9342b862e6
commit
5c6e97ccae
@ -1128,7 +1128,12 @@ public:
|
||||
/// It is assumed that no key in the interval is mapped to another value, but
|
||||
/// overlapping intervals already mapped to y will be coalesced.
|
||||
void insert(KeyT a, KeyT b, ValT y) {
|
||||
find(a).insert(a, b, y);
|
||||
if (branched() || rootSize == RootLeaf::Capacity)
|
||||
return find(a).insert(a, b, y);
|
||||
|
||||
// Easy insert into root leaf.
|
||||
unsigned p = rootLeaf().findFrom(0, rootSize, a);
|
||||
rootSize = rootLeaf().insertFrom(p, rootSize, a, b, y).second;
|
||||
}
|
||||
|
||||
/// clear - Remove all entries.
|
||||
|
Loading…
Reference in New Issue
Block a user