Skip to content

Commit 99a59e7

Browse files
KevinRansombaronfel
authored andcommitted
Feedback
1 parent 3a5004f commit 99a59e7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/fsharp/fsc.fs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,11 +840,16 @@ module MainModuleBuilder =
840840
let parseOrZero i (v:string) =
841841
let v =
842842
// When i = 3 then this is the 4th part of the version. The last part of the version can be trailed by any characters so we trim them off
843-
if i <> 3 then v
843+
if i <> 3 then
844+
v
844845
else
845-
v |> Seq.fold(fun (finished, v) c -> match finished with
846-
| false when Char.IsDigit(c) -> false, v + c.ToString()
847-
| _ -> true, v) (false, "") |> snd
846+
((false, ""), v)
847+
||> Seq.fold(fun (finished, v) c ->
848+
if finished || Char.IsDigit(c) then
849+
false, v + c.ToString()
850+
else
851+
true, v)
852+
|> snd
848853
match System.UInt16.TryParse v with
849854
| (true, i) -> i
850855
| (false, _) -> 0us

0 commit comments

Comments
 (0)