diff options
| author | Douglas Gregor <dgregor@apple.com> | 2012-10-09 23:02:47 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2012-10-09 23:02:47 +0000 |
| commit | 79258ca2ccb824371e5720de253f34b5e322b520 (patch) | |
| tree | 398370f878881e7b0638a19af1509abf1163776b | |
| parent | bbbbac6012880620c1b8689c6fd4b2c649e49d8c (diff) | |
| download | bcm5719-llvm-79258ca2ccb824371e5720de253f34b5e322b520.tar.gz bcm5719-llvm-79258ca2ccb824371e5720de253f34b5e322b520.zip | |
Add count() method to MapVector
llvm-svn: 165559
| -rw-r--r-- | llvm/include/llvm/ADT/MapVector.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/MapVector.h b/llvm/include/llvm/ADT/MapVector.h index 3f7a5964138..6aacca5a6f0 100644 --- a/llvm/include/llvm/ADT/MapVector.h +++ b/llvm/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; + } }; } |

