clean up one if-statement branch a little
This commit is contained in:
@@ -421,45 +421,35 @@ struct
|
|||||||
|
|
||||||
(* NEWLEFTLINES VERIFIED *)
|
(* NEWLEFTLINES VERIFIED *)
|
||||||
val newLeftLines =
|
val newLeftLines =
|
||||||
if Vector.length leftLinesHd = 0 then
|
if midpoint >= 0 then
|
||||||
Vector.map (fn el => el + String.size strSub1) newLines
|
(* Implicit: a binSearch match was found. *)
|
||||||
else
|
|
||||||
let
|
let
|
||||||
val newLeftLinesLength = midpoint + 1 + Vector.length newLines
|
val newLeftLinesLength = midpoint + 1 + Vector.length newLines
|
||||||
in
|
in
|
||||||
if newLeftLinesLength >= 0 then
|
|
||||||
Vector.tabulate (newLeftLinesLength, fn idx =>
|
Vector.tabulate (newLeftLinesLength, fn idx =>
|
||||||
if idx <= midpoint then
|
if idx <= midpoint then
|
||||||
Vector.sub (leftLinesHd, idx)
|
Vector.sub (leftLinesHd, idx)
|
||||||
else
|
else
|
||||||
Vector.sub (newLines, idx - (midpoint + 1))
|
Vector.sub (newLines, idx - (midpoint + 1))
|
||||||
+ String.size strSub1)
|
+ String.size strSub1)
|
||||||
else
|
|
||||||
Vector.fromList []
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
Vector.map (fn el => el + String.size strSub1) newLines
|
||||||
|
|
||||||
val _ = print "line 275\n"
|
val _ = print "line 275\n"
|
||||||
|
|
||||||
(* NEWRIGHTLINES VERIFIED *)
|
(* NEWRIGHTLINES VERIFIED *)
|
||||||
val newRightLines =
|
val newRightLines =
|
||||||
if Vector.length leftLinesHd = 0 then
|
if midpoint >= 0 then
|
||||||
Vector.fromList []
|
(* Implicit: a binSearch match was found. *)
|
||||||
else if midpoint >= 0 then
|
|
||||||
let
|
|
||||||
val _ = print "line 447\n"
|
|
||||||
in
|
|
||||||
Vector.tabulate
|
Vector.tabulate
|
||||||
( (Vector.length leftLinesHd - midpoint) - 1
|
( (Vector.length leftLinesHd - midpoint) - 1
|
||||||
, fn idx =>
|
, fn idx =>
|
||||||
Vector.sub (leftLinesHd, idx + midpoint + 1)
|
Vector.sub (leftLinesHd, idx + midpoint + 1)
|
||||||
- String.size strSub1
|
- String.size strSub1
|
||||||
)
|
)
|
||||||
end
|
|
||||||
else
|
else
|
||||||
(* midpoint = ~1 andalso Vector.length leftLinesHd > 0 *)
|
Vector.map (fn idx => idx - String.size strSub1) leftLinesHd
|
||||||
let val _ = print "line 458\n"
|
|
||||||
in Vector.map (fn idx => idx - String.size strSub1) leftLinesHd
|
|
||||||
end
|
|
||||||
in
|
in
|
||||||
verifyReturn
|
verifyReturn
|
||||||
{ idx = prevIdx + String.size strSub1 + String.size newString
|
{ idx = prevIdx + String.size strSub1 + String.size newString
|
||||||
|
|||||||
Reference in New Issue
Block a user