aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2017-03-24 17:09:11 -0400
committerEduardo Julian2017-03-24 17:09:11 -0400
commita33a0b4767ce510438a62a0108585c36b44df3aa (patch)
treead29badf28a304faf47121c3a597724ff1d474b8 /stdlib
parentb6af2b10fe9a4b0cd72ac10431858ff8a109adfb (diff)
- Now, only calculating the indices once, and reusing them through a definition.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/lux/data/coll/dict.lux4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdlib/source/lux/data/coll/dict.lux b/stdlib/source/lux/data/coll/dict.lux
index 87a40b745..72a549759 100644
--- a/stdlib/source/lux/data/coll/dict.lux
+++ b/stdlib/source/lux/data/coll/dict.lux
@@ -240,6 +240,8 @@
## When #Base nodes grow too large, they're promoted to #Hierarchy to
## add some depth to the tree and help keep it's balance.
+(def: hierarchy-indices (List Index) (indices-for hierarchy-nodes-size))
+
(def: (promote-base put' Hash<K> level bitmap base)
(All [K V]
(-> (-> Level Hash-Code K V (Hash K) (Node K V) (Node K V))
@@ -265,7 +267,7 @@
[+0
(: (Array (Node ($ +0) ($ +1)))
(array;new hierarchy-nodes-size))]
- (indices-for hierarchy-nodes-size))))
+ hierarchy-indices)))
## All empty nodes look the same (a #Base node with clean bitmap is
## used).