Yit Phang Khoo  committed b742388

Minor refactoring of SAArrayMappedTrie.add to avoid passing arguments unnecessarily.

  • Participants
  • Parent commits ea021dd

Comments (0)

Files changed (1)

File Source/Adapton/

         (** Create memoizing constructor and updater that adds a binding to an self-adjusting array mapped trie. *)
         let memo_add =
             let add, update_add = A.memo3 (module A) (module Types.Int) (module R) begin fun _ xs k v ->
-                let rec add xs s k v =
+                let rec add xs s =
                     (* if along k, initialize the next branch/leaf node, else lookup the subtrie under the prior AMT *)
                     if s > 0 then
                         Branches begin LazySparseArray.make begin fun d ->
                             if k lsr s land mask == d then
-                                Some (add xs (s - bits) k v)
+                                Some (add xs (s - bits))
                                 (* perform a partial key lookup for the corresponding subtrie under the prior AMT *)
                                 let rec subtrie xs s' = match xs with
                                 get xs (k land mask' lor d)
                         end end
-                add xs key_bits' k v
+                add xs key_bits'
             end in
             let add xs k v =
                 if k < 0 || k >= size then invalid_arg "index out of bounds";