projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
325f69d
)
Speed up simple insertions into an unbranched tree by not creating an iterator.
author
Jakob Stoklund Olesen
<stoklund@2pi.dk>
Sun, 28 Nov 2010 06:14:33 +0000
(06:14 +0000)
committer
Jakob Stoklund Olesen
<stoklund@2pi.dk>
Sun, 28 Nov 2010 06:14:33 +0000
(06:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120232
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/IntervalMap.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/IntervalMap.h
b/include/llvm/ADT/IntervalMap.h
index 0451a762add85efaafc963641a0d5bac9c53c36e..2758cbc562def7dd2d9bd183ebc42298b30b3569 100644
(file)
--- a/
include/llvm/ADT/IntervalMap.h
+++ b/
include/llvm/ADT/IntervalMap.h
@@
-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.