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:
fdbeb05
)
MapVector: Add lookup().
author
Benjamin Kramer
<benny.kra@googlemail.com>
Wed, 19 Dec 2012 11:08:33 +0000
(11:08 +0000)
committer
Benjamin Kramer
<benny.kra@googlemail.com>
Wed, 19 Dec 2012 11:08:33 +0000
(11:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170527
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/MapVector.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/MapVector.h
b/include/llvm/ADT/MapVector.h
index 42f8e553d43830584ba61d2f5e37bb750d126a52..c34e32a480d16dcd3c784fd7ab591943a27d9f61 100644
(file)
--- a/
include/llvm/ADT/MapVector.h
+++ b/
include/llvm/ADT/MapVector.h
@@
-79,6
+79,11
@@
public:
return Vector[I].second;
}
+ ValueT lookup(const KeyT &Key) const {
+ typename MapType::const_iterator Pos = Map.find(Key);
+ return Pos == Map.end()? ValueT() : Vector[Pos->second].second;
+ }
+
unsigned count(const KeyT &Key) const {
typename MapType::const_iterator Pos = Map.find(Key);
return Pos == Map.end()? 0 : 1;