Skip to content

Commit 551d136

Browse files
committed
Declare local variable 'auto' to avoid type errors for const containers.
1 parent 1b3885c commit 551d136

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/containers/hashmap.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
142142
alias CET = ContainerElementType!(This, V);
143143

144144
size_t i;
145-
Node* n = find(key, i);
145+
auto n = find(key, i);
146146
if (n is null)
147147
return defaultValue;
148148
return cast(CET) n.value;
@@ -164,7 +164,7 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
164164
alias CET = ContainerElementType!(This, V);
165165

166166
Hash hash = hashFunction(key);
167-
Node* n = find(key, hash);
167+
auto n = find(key, hash);
168168
if (n is null)
169169
return cast(CET*) &insert(key, defaultValue).value;
170170
else
@@ -201,7 +201,7 @@ struct HashMap(K, V, Allocator = Mallocator, alias hashFunction = generateHash!K
201201
bool remove(K key)
202202
{
203203
size_t i;
204-
Node* n = find(key, i);
204+
auto n = find(key, i);
205205
if (n is null)
206206
return false;
207207
immutable bool removed = buckets[i].remove(Node(n.hash, n.key));

0 commit comments

Comments
 (0)