[llvm-commits] [llvm] r165559 - /llvm/trunk/include/llvm/ADT/MapVector.h

Douglas Gregor dgregor at apple.com
Tue Oct 9 16:02:47 PDT 2012


Author: dgregor
Date: Tue Oct  9 18:02:47 2012
New Revision: 165559

URL: http://llvm.org/viewvc/llvm-project?rev=165559&view=rev
Log:
Add count() method to MapVector

Modified:
    llvm/trunk/include/llvm/ADT/MapVector.h

Modified: llvm/trunk/include/llvm/ADT/MapVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/MapVector.h?rev=165559&r1=165558&r2=165559&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/MapVector.h (original)
+++ llvm/trunk/include/llvm/ADT/MapVector.h Tue Oct  9 18:02:47 2012
@@ -78,6 +78,11 @@
     }
     return Vector[I].second;
   }
+
+  unsigned count(const KeyT &Key) const {
+    typename MapType::const_iterator Pos = Map.find(Key);
+    return Pos == Map.end()? 0 : 1;
+  }
 };
 
 }





More information about the llvm-commits mailing list