diff --git a/src/util/map/hashmap.scad b/src/util/map/hashmap.scad index 927d569d..3e1ef9e7 100644 --- a/src/util/map/hashmap.scad +++ b/src/util/map/hashmap.scad @@ -2,13 +2,13 @@ use <../../__comm__/_str_hash.scad>; use <_impl/_hashmap_impl.scad>; use <_impl/_hashmap_put_impl.scad>; -function hashmap(kv_lt, eq = function(e1, e2) e1 == e2, hash = function(e) _str_hash(e), bucket_numbers) = +function hashmap(kv_lt, eq = function(e1, e2) e1 == e2, hash = function(e) _str_hash(e), number_of_buckets) = let( kv_lt_undef = is_undef(kv_lt), leng_kv_lt = kv_lt_undef ? -1 : len(kv_lt), - bucket_numbers_undef = is_undef(bucket_numbers), - b_numbers = bucket_numbers_undef ? - (kv_lt_undef || leng_kv_lt < 256 ? 16 : ceil(sqrt(leng_kv_lt))) : bucket_numbers, + number_of_buckets_undef = is_undef(number_of_buckets), + b_numbers = number_of_buckets_undef ? + (kv_lt_undef || leng_kv_lt < 256 ? 16 : ceil(sqrt(leng_kv_lt))) : number_of_buckets, buckets = [for(i = [0:b_numbers - 1]) []] ) kv_lt_undef ? buckets : _hashmap(kv_lt, leng_kv_lt, buckets, eq, hash); \ No newline at end of file diff --git a/src/util/set/hashset.scad b/src/util/set/hashset.scad index bef10087..4dc3ff6a 100644 --- a/src/util/set/hashset.scad +++ b/src/util/set/hashset.scad @@ -2,13 +2,13 @@ use <../../__comm__/_str_hash.scad>; use <_impl/_hashset_impl.scad>; use <_impl/_hashset_add_impl.scad>; -function hashset(lt, eq = function(e1, e2) e1 == e2, hash = function(e) _str_hash(e), bucket_numbers) = +function hashset(lt, eq = function(e1, e2) e1 == e2, hash = function(e) _str_hash(e), number_of_buckets) = let( lt_undef = is_undef(lt), leng_lt = lt_undef ? -1 : len(lt), - bucket_numbers_undef = is_undef(bucket_numbers), - b_numbers = bucket_numbers_undef ? - (lt_undef || leng_lt < 256 ? 16 : ceil(sqrt(leng_lt))) : bucket_numbers, + number_of_buckets_undef = is_undef(number_of_buckets), + b_numbers = number_of_buckets_undef ? + (lt_undef || leng_lt < 256 ? 16 : ceil(sqrt(leng_lt))) : number_of_buckets, buckets = [for(i = [0:b_numbers - 1]) []] ) lt_undef ? buckets : _hashset(lt, leng_lt, buckets, eq, hash); \ No newline at end of file