From: Douglas Gregor Date: Tue, 9 Oct 2012 23:02:47 +0000 (+0000) Subject: Add count() method to MapVector X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8161d81239f1d125cb1aeaf0be6916c36d4cdf2f;p=oota-llvm.git Add count() method to MapVector git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165559 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/MapVector.h b/include/llvm/ADT/MapVector.h index 3f7a5964138..6aacca5a6f0 100644 --- 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; + } }; }