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

Side by Side Diff: runtime/platform/hashmap.cc

Issue 14572004: Put HashMap class in dart namespace. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« runtime/platform/hashmap.h ('K') | « runtime/platform/hashmap.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/hashmap.h" 5 #include "platform/hashmap.h"
6 6
7 #include "bin/builtin.h" 7 #include "bin/builtin.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 9
10 HashMap::HashMap(MatchFun match, 10 namespace dart {
11 uint32_t initial_capacity) { 11
12 HashMap::HashMap(MatchFun match, uint32_t initial_capacity) {
12 match_ = match; 13 match_ = match;
13 Initialize(initial_capacity); 14 Initialize(initial_capacity);
14 } 15 }
15 16
16 17
17 HashMap::~HashMap() { 18 HashMap::~HashMap() {
18 free(map_); 19 free(map_);
19 } 20 }
20 21
21 22
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 for (Entry* p = map; n > 0; p++) { 182 for (Entry* p = map; n > 0; p++) {
182 if (p->key != NULL) { 183 if (p->key != NULL) {
183 Lookup(p->key, p->hash, true)->value = p->value; 184 Lookup(p->key, p->hash, true)->value = p->value;
184 n--; 185 n--;
185 } 186 }
186 } 187 }
187 188
188 // Delete old map. 189 // Delete old map.
189 free(map); 190 free(map);
190 } 191 }
192
193 } // namespace dart
OLDNEW
« runtime/platform/hashmap.h ('K') | « runtime/platform/hashmap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698