From a33a0b4767ce510438a62a0108585c36b44df3aa Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 24 Mar 2017 17:09:11 -0400 Subject: - Now, only calculating the indices once, and reusing them through a definition. --- stdlib/source/lux/data/coll/dict.lux | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stdlib') 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 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). -- cgit v1.2.3