Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: test/cctest/test-hashmap.cc

Issue 1074943002: Split TemplateHashMapImpl::Lookup into two methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm (and ppc) builds Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/cctest/test-hashmap.cc
diff --git a/test/cctest/test-hashmap.cc b/test/cctest/test-hashmap.cc
index 68a7e8911bd48f6d1f2c57b4f8fddd8f1021cd0f..fb56225fb4432a7f0b17acc78e73290ba395b447 100644
--- a/test/cctest/test-hashmap.cc
+++ b/test/cctest/test-hashmap.cc
@@ -48,7 +48,8 @@ class IntSet {
void Insert(int x) {
CHECK_NE(0, x); // 0 corresponds to (void*)NULL - illegal key value
- HashMap::Entry* p = map_.Lookup(reinterpret_cast<void*>(x), hash_(x), true);
+ HashMap::Entry* p =
+ map_.LookupOrInsert(reinterpret_cast<void*>(x), hash_(x));
CHECK(p != NULL); // insert is set!
CHECK_EQ(reinterpret_cast<void*>(x), p->key);
// we don't care about p->value
@@ -60,8 +61,7 @@ class IntSet {
}
bool Present(int x) {
- HashMap::Entry* p =
- map_.Lookup(reinterpret_cast<void*>(x), hash_(x), false);
+ HashMap::Entry* p = map_.Lookup(reinterpret_cast<void*>(x), hash_(x));
if (p != NULL) {
CHECK_EQ(reinterpret_cast<void*>(x), p->key);
}

Powered by Google App Engine
This is Rietveld 408576698