mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
refactor
This commit is contained in:
@@ -13,10 +13,10 @@ function _dedup_add(buckets, i_elem, eq, hash, bucket_numbers) =
|
|||||||
b_idx = hash(elem) % bucket_numbers,
|
b_idx = hash(elem) % bucket_numbers,
|
||||||
bucket = buckets[b_idx]
|
bucket = buckets[b_idx]
|
||||||
)
|
)
|
||||||
len(bucket) == 0 ? concat(slice(buckets, 0, b_idx), [[i_elem]], slice(buckets, b_idx + 1)) :
|
some(bucket, function(i_e) eq(i_e[1], elem)) ? buckets : _add(buckets, bucket, i_elem, b_idx);
|
||||||
some(bucket, function(i_e) eq(i_e[1], elem)) ? buckets :
|
|
||||||
concat(
|
function _add(buckets, bucket, i_elem, b_idx) = concat(
|
||||||
slice(buckets, 0, b_idx),
|
slice(buckets, 0, b_idx),
|
||||||
[concat(bucket, [i_elem])],
|
[concat(bucket, [i_elem])],
|
||||||
slice(buckets, b_idx + 1)
|
slice(buckets, b_idx + 1)
|
||||||
);
|
);
|
Reference in New Issue
Block a user