Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
Small improvement for String.length (dotnet#9469)
Browse files Browse the repository at this point in the history
* Simplify and improve perf of String.length

* Improve performance of String.map

* Revert "Improve performance of String.map"

* Turn String.length into a one-liner, fixes dotnet#9469 (comment)
  • Loading branch information
abelbraaksma authored and nosami committed Feb 22, 2021
1 parent 3eb4140 commit d6123c3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/fsharp/FSharp.Core/string.fs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,4 @@ namespace Microsoft.FSharp.Core
check 0

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

0 comments on commit d6123c3

Please sign in to comment.