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

Unified Diff: src/objects.cc

Issue 290733008: Teach OrderedHashSet::Remove to report whether it actually removed anything (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index a1ca34ead8dc83ec02d448eeb23d0953409df07a..769d5fc8b61b89e3554a45220654e3c8ea7577e0 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -16456,9 +16456,14 @@ Handle<OrderedHashSet> OrderedHashSet::Add(Handle<OrderedHashSet> table,
Handle<OrderedHashSet> OrderedHashSet::Remove(Handle<OrderedHashSet> table,
- Handle<Object> key) {
+ Handle<Object> key,
+ bool* was_present) {
int entry = table->FindEntry(key);
- if (entry == kNotFound) return table;
+ if (entry == kNotFound) {
+ *was_present = false;
+ return table;
+ }
+ *was_present = true;
table->RemoveEntry(entry);
return Shrink(table);
}
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698