Skip to content

Commit

Permalink
yield needs to be this way for tail-recursion.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorium committed Jul 7, 2024
1 parent a1815a8 commit 26e2938
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/FSharpx.Extras/Strings.fs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,9 @@ module Strings =
| ValuePatterns.Lower _ when not takeUpper -> consume from takeUpper (i + 1)
| ValuePatterns.Upper _ when takeUpper -> consume from takeUpper (i + 1)
| _ ->
let r1 = struct(from, i)
let r2 = restart i
seq {
yield r1
yield! r2 }
yield struct(from, i)
yield! restart i }

// Split string into segments and turn them to PascalCase
seq { for i1, i2 in restart 0 do
Expand Down

0 comments on commit 26e2938

Please sign in to comment.