Skip to content
Merged
Prev Previous commit
Next Next commit
Revert "Simplify and improve perf of String.length"
  • Loading branch information
abelbraaksma committed Jun 17, 2020
commit 10e583320f232435d10f5c986e91a431c722447a
6 changes: 4 additions & 2 deletions src/fsharp/FSharp.Core/string.fs
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,7 @@ namespace Microsoft.FSharp.Core

[<CompiledName("Length")>]
let length (str:string) =
if isNull str then 0
else str.Length
if String.IsNullOrEmpty str then
0
else
str.Length