We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 60a5659 commit ca6c54bCopy full SHA for ca6c54b
1 file changed
src/fsharp/FSharp.Core/reflect.fs
@@ -166,9 +166,9 @@ module internal Impl =
166
let nm = minfo.Name
167
// chop "get_" or "New" off the front
168
let nm =
169
- if not (isListType typ) && not (isOptionType typ) then
170
- if nm.Length > 4 && nm.[0..3] = "get_" then nm.[4..]
171
- elif nm.Length > 3 && nm.[0..2] = "New" then nm.[3..]
+ if not (isListType typ) && not (isOptionType typ) && nm.Length > 3 then
+ if nm.StartsWith ("get_", StringComparison.Ordinal) then nm.[4..]
+ elif nm.StartsWith ("New", StringComparison.Ordinal) then nm.[3..]
172
else nm
173
174
Some (n, nm)
0 commit comments