From e2da10e908d186a4c4700f11d12bca6c1af43911 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Fri, 14 Feb 2025 13:02:42 +0000 Subject: [PATCH] amend 'removeMiddle' function in gap_map.sml: before, we were leaving element we want to remove in rkhd/rvhd because we started the slice at 'insPos', but now we increment 'insPos' by 1 so we filter that desired element out --- src/gap_map.sml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gap_map.sml b/src/gap_map.sml index 6836e82..26cda84 100644 --- a/src/gap_map.sml +++ b/src/gap_map.sml @@ -878,12 +878,14 @@ struct fun removeMiddle (khd, vhd, insPos, leftKeys, leftVals, rightKeys, rightVals) = let - val rLen = Vector.length khd - insPos + val rStart = insPos + 1 + val rLen = Vector.length khd - rStart + val lkhd = VectorSlice.slice (khd, 0, SOME insPos) - val rkhd = VectorSlice.slice (khd, insPos, SOME rLen) + val rkhd = VectorSlice.slice (khd, rStart, SOME rLen) val lvhd = VectorSlice.slice (vhd, 0, SOME insPos) - val rvhd = VectorSlice.slice (vhd, insPos, SOME rLen) + val rvhd = VectorSlice.slice (vhd, rStart, SOME rLen) val khd = VectorSlice.concat [lkhd, rkhd] val vhd = VectorSlice.concat [lvhd, rvhd]