1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-17 20:11:50 +02:00

refactor: del var

This commit is contained in:
Justin Lin
2022-04-18 18:28:25 +08:00
parent 4031fee5bb
commit a0e465a635
2 changed files with 2 additions and 4 deletions

View File

@@ -15,8 +15,7 @@ function hashmap(kv_lt, eq = undef, hash = function(e) _str_hash(e), number_of_b
let( let(
kv_lt_undef = is_undef(kv_lt), kv_lt_undef = is_undef(kv_lt),
leng_kv_lt = kv_lt_undef ? -1 : len(kv_lt), leng_kv_lt = kv_lt_undef ? -1 : len(kv_lt),
number_of_buckets_undef = is_undef(number_of_buckets), b_numbers = 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, (kv_lt_undef || leng_kv_lt < 256 ? 16 : ceil(sqrt(leng_kv_lt))) : number_of_buckets,
buckets = [for(i = [0:b_numbers - 1]) []] buckets = [for(i = [0:b_numbers - 1]) []]
) )

View File

@@ -16,8 +16,7 @@ function hashset(lt, eq = undef, hash = function(e) _str_hash(e), number_of_buck
let( let(
lt_undef = is_undef(lt), lt_undef = is_undef(lt),
leng_lt = lt_undef ? -1 : len(lt), leng_lt = lt_undef ? -1 : len(lt),
number_of_buckets_undef = is_undef(number_of_buckets), b_numbers = is_undef(number_of_buckets) ?
b_numbers = number_of_buckets_undef ?
(lt_undef || leng_lt < 256 ? 16 : ceil(sqrt(leng_lt))) : number_of_buckets, (lt_undef || leng_lt < 256 ? 16 : ceil(sqrt(leng_lt))) : number_of_buckets,
buckets = [for(i = [0:b_numbers - 1]) []] buckets = [for(i = [0:b_numbers - 1]) []]
) )