Extend StringRef's edit-distance algorithm to permit an upper bound on the allowed...
[oota-llvm.git] / include / llvm / ADT / ScopedHashTable.h
index f325e2b9f30928a0d6c1ef1deb138249d05c5357..c96ad19707f38a2bdade59507120bde1bd05078b 100644 (file)
@@ -139,7 +139,12 @@ public:
   }
 
   V lookup(const K &Key) {
-    return TopLevelMap[Key].getValue();
+    typename DenseMap<K, ScopedHashTableVal<K, V, KInfo>*, KInfo>::iterator
+      I = TopLevelMap.find(Key);
+    if (I != TopLevelMap.end())
+      return I->second->getValue();
+      
+    return V();
   }
 
   void insert(const K &Key, const V &Val) {