Skip to content

Commit 26e2938

Browse files
committed
yield needs to be this way for tail-recursion.
1 parent a1815a8 commit 26e2938

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/FSharpx.Extras/Strings.fs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,9 @@ module Strings =
137137
| ValuePatterns.Lower _ when not takeUpper -> consume from takeUpper (i + 1)
138138
| ValuePatterns.Upper _ when takeUpper -> consume from takeUpper (i + 1)
139139
| _ ->
140-
let r1 = struct(from, i)
141-
let r2 = restart i
142140
seq {
143-
yield r1
144-
yield! r2 }
141+
yield struct(from, i)
142+
yield! restart i }
145143

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

0 commit comments

Comments
 (0)