@@ -43,7 +43,7 @@ class TemplateHashMapImpl {
43
43
44
44
// If an entry with matching key is found, returns that entry.
45
45
// Otherwise, NULL is returned.
46
- Entry* Lookup (void * key, uint32_t hash);
46
+ Entry* Lookup (void * key, uint32_t hash) const ;
47
47
48
48
// If an entry with matching key is found, returns that entry.
49
49
// If no matching entry is found, a new entry is inserted with
@@ -90,7 +90,7 @@ class TemplateHashMapImpl {
90
90
uint32_t occupancy_;
91
91
92
92
Entry* map_end () const { return map_ + capacity_; }
93
- Entry* Probe (void * key, uint32_t hash);
93
+ Entry* Probe (void * key, uint32_t hash) const ;
94
94
void Initialize (uint32_t capacity, AllocationPolicy allocator);
95
95
void Resize (AllocationPolicy allocator);
96
96
};
@@ -113,7 +113,7 @@ TemplateHashMapImpl<AllocationPolicy>::~TemplateHashMapImpl() {
113
113
114
114
template <class AllocationPolicy >
115
115
typename TemplateHashMapImpl<AllocationPolicy>::Entry*
116
- TemplateHashMapImpl<AllocationPolicy>::Lookup(void * key, uint32_t hash) {
116
+ TemplateHashMapImpl<AllocationPolicy>::Lookup(void * key, uint32_t hash) const {
117
117
Entry* p = Probe (key, hash);
118
118
return p->key != NULL ? p : NULL ;
119
119
}
@@ -242,7 +242,7 @@ typename TemplateHashMapImpl<AllocationPolicy>::Entry*
242
242
243
243
template <class AllocationPolicy >
244
244
typename TemplateHashMapImpl<AllocationPolicy>::Entry*
245
- TemplateHashMapImpl<AllocationPolicy>::Probe(void * key, uint32_t hash) {
245
+ TemplateHashMapImpl<AllocationPolicy>::Probe(void * key, uint32_t hash) const {
246
246
DCHECK (key != NULL );
247
247
248
248
DCHECK (base::bits::IsPowerOfTwo32 (capacity_));
0 commit comments