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

Unified Diff: runtime/vm/hash_table.h

Issue 583443003: Add 'Clear' method to HashMap/HashSet templates. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | runtime/vm/hash_table_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/hash_table.h
===================================================================
--- runtime/vm/hash_table.h (revision 40404)
+++ runtime/vm/hash_table.h (working copy)
@@ -562,9 +562,14 @@
}
}
+ void Clear() const {
+ BaseIterTable::Initialize();
+ }
+
protected:
void EnsureCapacity() const {
static const double kMaxLoadFactor = 0.75;
+ // We currently never shrink.
HashTables::EnsureLoadFactor(0.0, kMaxLoadFactor, *this);
}
};
@@ -651,9 +656,14 @@
}
}
+ void Clear() const {
+ BaseIterTable::Initialize();
+ }
+
protected:
void EnsureCapacity() const {
static const double kMaxLoadFactor = 0.75;
+ // We currently never shrink.
HashTables::EnsureLoadFactor(0.0, kMaxLoadFactor, *this);
}
};
« no previous file with comments | « no previous file | runtime/vm/hash_table_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698