aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/coll/vector.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/data/coll/vector.lux')
-rw-r--r--stdlib/source/lux/data/coll/vector.lux12
1 files changed, 6 insertions, 6 deletions
diff --git a/stdlib/source/lux/data/coll/vector.lux b/stdlib/source/lux/data/coll/vector.lux
index c9d223736..23d07068e 100644
--- a/stdlib/source/lux/data/coll/vector.lux
+++ b/stdlib/source/lux/data/coll/vector.lux
@@ -71,7 +71,7 @@
(if (n.< full-node-size vec-size)
+0
(|> (n.dec vec-size)
- (bit;unsigned-shift-right branching-exponent)
+ (bit;shift-right branching-exponent)
(bit;shift-left branching-exponent))))
(def: (new-path level tail)
@@ -91,7 +91,7 @@
(def: (push-tail size level tail parent)
(All [a] (-> Nat Level (Base a) (Hierarchy a) (Hierarchy a)))
- (let [sub-idx (branch-idx (bit;unsigned-shift-right level (n.dec size)))
+ (let [sub-idx (branch-idx (bit;shift-right level (n.dec size)))
## If we're currently on a bottom node
sub-node (if (n.= branching-exponent level)
## Just add the tail to it
@@ -122,7 +122,7 @@
(def: (put' level idx val hierarchy)
(All [a] (-> Level Index a (Hierarchy a) (Hierarchy a)))
- (let [sub-idx (branch-idx (bit;unsigned-shift-right level idx))]
+ (let [sub-idx (branch-idx (bit;shift-right level idx))]
(case (array;get sub-idx hierarchy)
(#;Some (#Hierarchy sub-node))
(|> (array;clone hierarchy)
@@ -140,7 +140,7 @@
(def: (pop-tail size level hierarchy)
(All [a] (-> Nat Level (Hierarchy a) (Maybe (Hierarchy a))))
- (let [sub-idx (branch-idx (bit;unsigned-shift-right level (n.- +2 size)))]
+ (let [sub-idx (branch-idx (bit;shift-right level (n.- +2 size)))]
(cond (n.= +0 sub-idx)
#;None
@@ -208,7 +208,7 @@
## --------------------------------------------------------
## Will the root experience an overflow with this addition?
(|> (if (n.> (bit;shift-left (get@ #level vec) +1)
- (bit;unsigned-shift-right branching-exponent vec-size))
+ (bit;shift-right branching-exponent vec-size))
## If so, a brand-new root must be established, that is
## 1-level taller.
(|> vec
@@ -236,7 +236,7 @@
(loop [level (get@ #level vec)
hierarchy (get@ #root vec)]
(case [(n.> branching-exponent level)
- (array;get (branch-idx (bit;unsigned-shift-right level idx)) hierarchy)]
+ (array;get (branch-idx (bit;shift-right level idx)) hierarchy)]
[true (#;Some (#Hierarchy sub))]
(recur (level-down level) sub)