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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart

Issue 13725009: Don't bother storing 0 into the hash table if it's already there. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart
index b16f8696ed4efbb15fde8cf86c961930e6670c7c..da518282096a8daa0b3c8dbda198781faa727587 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart
@@ -530,11 +530,10 @@ patch class HashSet<E> {
}
void _addHashTableEntry(var table, E element) {
- if (!_hasTableEntry(table, element)) {
- _length++;
- _elements = null;
- }
+ if (_hasTableEntry(table, element)) return;
_setTableEntry(table, element, 0);
+ _length++;
+ _elements = null;
}
bool _removeHashTableEntry(var table, E element) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698