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:
63b8ab2
)
Add count() method to MapVector
author
Douglas Gregor
<dgregor@apple.com>
Tue, 9 Oct 2012 23:02:47 +0000
(23:02 +0000)
committer
Douglas Gregor
<dgregor@apple.com>
Tue, 9 Oct 2012 23:02:47 +0000
(23:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165559
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 3f7a59641381cd484424e4cc4f6a87bb74c54336..6aacca5a6f0fc5c17c87ae1f9fb9fb4dd868cee4 100644
(file)
--- a/
include/llvm/ADT/MapVector.h
+++ b/
include/llvm/ADT/MapVector.h
@@
-78,6
+78,11
@@
public:
}
return Vector[I].second;
}
+
+ unsigned count(const KeyT &Key) const {
+ typename MapType::const_iterator Pos = Map.find(Key);
+ return Pos == Map.end()? 0 : 1;
+ }
};
}