@@ -291,7 +291,7 @@ function empty!(h::RobinDict{K,V}) where {K, V}
291
291
return h
292
292
end
293
293
294
- function rh_search (h:: RobinDict{K, V} , key:: K ) where {K, V}
294
+ function rh_search (h:: RobinDict{K, V} , key) where {K, V}
295
295
sz = length (h. keys)
296
296
chash = hash_key (key)
297
297
index = desired_index (chash, sz)
@@ -367,8 +367,7 @@ function _get!(default::Callable, h::RobinDict{K,V}, key::K) where V where K
367
367
return v
368
368
end
369
369
370
- function getindex (h:: RobinDict{K, V} , key0) where {K, V}
371
- key = convert (K, key0)
370
+ function getindex (h:: RobinDict{K, V} , key) where {K, V}
372
371
index = rh_search (h, key)
373
372
@inbounds return (index < 0 ) ? throw (KeyError (key)) : h. vals[index]
374
373
end
@@ -392,8 +391,7 @@ julia> get(d, "c", 3)
392
391
"""
393
392
get (collection, key, default)
394
393
395
- function get (h:: RobinDict{K,V} , key0, default) where {K, V}
396
- key = convert (K, key0)
394
+ function get (h:: RobinDict{K,V} , key, default) where {K, V}
397
395
index = rh_search (h, key)
398
396
@inbounds return (index < 0 ) ? default : h. vals[index]:: V
399
397
end
415
413
"""
416
414
get (:: Function , collection, key)
417
415
418
- function get (default:: Callable , h:: RobinDict{K,V} , key0) where {K, V}
419
- key = convert (K, key0)
416
+ function get (default:: Callable , h:: RobinDict{K,V} , key) where {K, V}
420
417
index = rh_search (h, key)
421
418
@inbounds return (index < 0 ) ? default () : h. vals[index]:: V
422
419
end
@@ -462,8 +459,7 @@ julia> getkey(D, 'd', 'a')
462
459
'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)
463
460
```
464
461
"""
465
- function getkey (h:: RobinDict{K,V} , key0, default) where {K, V}
466
- key = convert (K, key0)
462
+ function getkey (h:: RobinDict{K,V} , key, default) where {K, V}
467
463
index = rh_search (h, key)
468
464
@inbounds return (index < 0 ) ? default : h. keys[index]:: K
469
465
end
0 commit comments