@@ -173,7 +173,7 @@ type ApiDocAttribute(name, fullName, constructorArguments, namedConstructorArgum
173173 member x.ObsoleteMessage =
174174 let tryFindObsoleteMessage =
175175 x.ConstructorArguments
176- |> Seq .tryFind ( fun x -> x :? string)
176+ |> List .tryFind ( fun x -> x :? string)
177177 |> Option.map string
178178 |> Option.defaultValue " "
179179
@@ -186,7 +186,7 @@ type ApiDocAttribute(name, fullName, constructorArguments, namedConstructorArgum
186186 member x.CustomOperationName =
187187 let tryFindCustomOperation =
188188 x.ConstructorArguments
189- |> Seq .tryFind ( fun x -> x :? string)
189+ |> List .tryFind ( fun x -> x :? string)
190190 |> Option.map string
191191 |> Option.defaultValue " "
192192
@@ -200,7 +200,10 @@ type ApiDocAttribute(name, fullName, constructorArguments, namedConstructorArgum
200200 let dropSuffix ( s : string ) ( t : string ) = s.[ 0 .. s.Length - t.Length - 1 ]
201201
202202 let attributeName =
203- if removeAttributeSuffix && attributeName.EndsWith " Attribute" then
203+ if
204+ removeAttributeSuffix
205+ && attributeName.EndsWith( " Attribute" , StringComparison.Ordinal)
206+ then
204207 dropSuffix attributeName " Attribute"
205208 else
206209 attributeName
@@ -368,7 +371,7 @@ type ApiDocMember
368371 printfn " %s (%d ,%d ): error: duplicate id for example '%s '" m.FileName m.StartLine m.StartColumn id
369372
370373 for ( id, _ count) in knownExampleIds do
371- if id.StartsWith " example-" then
374+ if id.StartsWith( " example-" , StringComparison.Ordinal ) then
372375 let potentialInteger = id.[ " example-" .Length ..]
373376
374377 match System.Int32.TryParse potentialInteger with
@@ -482,13 +485,13 @@ type ApiDocMember
482485 member x.Symbol : FSharpSymbol = symbol
483486
484487 /// Gets a value indicating whether this member is obsolete
485- member x.IsObsolete = x.Attributes |> Seq .exists ( fun a -> a.IsObsoleteAttribute)
488+ member x.IsObsolete = x.Attributes |> List .exists ( fun a -> a.IsObsoleteAttribute)
486489
487490 /// Returns the obsolete message, when this member is obsolete. When its not or no message was specified, an empty string is returned
488491 member x.ObsoleteMessage = ApiDocAttribute.TryGetObsoleteMessage( x.Attributes)
489492
490493 member x.IsRequireQualifiedAccessAttribute =
491- x.Attributes |> Seq .exists ( fun a -> a.IsRequireQualifiedAccessAttribute)
494+ x.Attributes |> List .exists ( fun a -> a.IsRequireQualifiedAccessAttribute)
492495
493496 /// Returns the custom operation name, when this attribute is the CustomOperationAttribute.
494497 member x.CustomOperationName = ApiDocAttribute.TryGetCustomOperationName( x.Attributes)
@@ -602,7 +605,7 @@ type ApiDocEntity
602605 member x.StaticMembers : ApiDocMember list = stat
603606
604607 /// Gets a value indicating whether this member is obsolete
605- member x.IsObsolete = x.Attributes |> Seq .exists ( fun a -> a.IsObsoleteAttribute)
608+ member x.IsObsolete = x.Attributes |> List .exists ( fun a -> a.IsObsoleteAttribute)
606609
607610 /// Returns the obsolete message, when this member is obsolete. When its not or no message was specified, an empty string is returned
608611 member x.ObsoleteMessage = ApiDocAttribute.TryGetObsoleteMessage( x.Attributes)
@@ -782,7 +785,8 @@ type internal CrossReferenceResolver(root, collectionName, qualify, extensions)
782785
783786 let nameGen ( name : string ) =
784787 let nice =
785- ( toReplace |> Seq.fold ( fun ( s : string ) ( inv , repl ) -> s.Replace( inv, repl)) name)
788+ ( toReplace
789+ |> List.fold ( fun ( s : string ) ( inv , repl ) -> s.Replace( inv, repl)) name)
786790 .ToLower()
787791
788792 let found =
@@ -837,7 +841,7 @@ type internal CrossReferenceResolver(root, collectionName, qualify, extensions)
837841 failwithf " The entity %s was not registered before!" ( sprintf " %s .%s " entity.AccessPath entity.CompiledName)
838842
839843 let removeParen ( memberName : string ) =
840- let firstParen = memberName.IndexOf( " ( " )
844+ let firstParen = memberName.IndexOf( '(' )
841845
842846 if firstParen > 0 then
843847 memberName.Substring( 0 , firstParen)
@@ -874,7 +878,7 @@ type internal CrossReferenceResolver(root, collectionName, qualify, extensions)
874878 let noNamespaceParts =
875879 if hasModuleSuffix then
876880 match noNamespaceParts with
877- | h :: t when h.EndsWith( " Module" ) -> h.[ 0 .. h.Length - 7 ] :: t
881+ | h :: t when h.EndsWith( " Module" , StringComparison.Ordinal ) -> h.[ 0 .. h.Length - 7 ] :: t
878882 | s -> s
879883 else
880884 noNamespaceParts
@@ -890,7 +894,10 @@ type internal CrossReferenceResolver(root, collectionName, qualify, extensions)
890894 noGenerics
891895
892896 let externalDocsLink isMember simple ( typeName : string ) ( fullName : string ) =
893- if fullName.StartsWith " FSharp." || fullName.StartsWith " Microsoft.FSharp." then
897+ if
898+ fullName.StartsWith( " FSharp." , StringComparison.Ordinal)
899+ || fullName.StartsWith( " Microsoft.FSharp." , StringComparison.Ordinal)
900+ then
894901 let noParen = removeParen typeName
895902
896903 let docs =
@@ -1051,9 +1058,9 @@ type internal CrossReferenceResolver(root, collectionName, qualify, extensions)
10511058
10521059 match cref with
10531060 // Type
1054- | _ when cref.StartsWith( " T:" ) -> Some( resolveCrossReferenceForTypeByXmlSig cref)
1061+ | _ when cref.StartsWith( " T:" , StringComparison.Ordinal ) -> Some( resolveCrossReferenceForTypeByXmlSig cref)
10551062 // Compiler was unable to resolve!
1056- | _ when cref.StartsWith( " !:" ) ->
1063+ | _ when cref.StartsWith( " !:" , StringComparison.Ordinal ) ->
10571064 Log.warnf " Compiler was unable to resolve %s " cref
10581065 None
10591066 // ApiDocMember
@@ -1165,7 +1172,7 @@ module internal TypeFormatter =
11651172 match args with
11661173 | [] -> typeName
11671174 | [ arg ] ->
1168- if tcref.DisplayName.StartsWith " [ " then
1175+ if tcref.DisplayName.StartsWith '[' then
11691176 span [] [ formatTypeWithPrecAsHtml ctx 2 arg; !! tcref.DisplayName ]
11701177 else
11711178 span [] [ formatTypeWithPrecAsHtml ctx 2 arg; !! "  " ; typeName ]
@@ -1581,7 +1588,7 @@ module internal SymbolReader =
15811588 let readUnionCase ( ctx : ReadingContext ) ( _typ : FSharpEntity ) ( case : FSharpUnionCase ) =
15821589
15831590 let formatFieldUsage ( field : FSharpField ) =
1584- if field.Name.StartsWith( " Item" ) then
1591+ if field.Name.StartsWith( " Item" , StringComparison.Ordinal ) then
15851592 formatTypeAsHtml ctx.UrlMap field.FieldType
15861593 else
15871594 !! field.Name
@@ -1993,7 +2000,7 @@ module internal SymbolReader =
19932000 let remarks =
19942001 let remarkNodes = doc.Elements( XName.Get " remarks" ) |> Seq.toList
19952002
1996- if Seq .length remarkNodes > 0 then
2003+ if List .length remarkNodes > 0 then
19972004 let html = new StringBuilder()
19982005
19992006 for ( id, e) in List.indexed remarkNodes do
@@ -2036,7 +2043,11 @@ module internal SymbolReader =
20362043 // FSharp.Core cref listings don't start with "T:", see https://github.com/dotnet/fsharp/issues/9805
20372044 let cname = cref.Value
20382045
2039- let cname = if cname.StartsWith( " T:" ) then cname else " T:" + cname // FSharp.Core exception listings don't start with "T:"
2046+ let cname =
2047+ if cname.StartsWith( " T:" , StringComparison.Ordinal) then
2048+ cname
2049+ else
2050+ " T:" + cname // FSharp.Core exception listings don't start with "T:"
20402051
20412052 match urlMap.ResolveCref cname with
20422053 | Some reference ->
@@ -2095,7 +2106,7 @@ module internal SymbolReader =
20952106
20962107 match lst with
20972108 | [ x ] -> rawData.[ n] <- x.Value
2098- | lst -> lst |> Seq .iteri ( fun id el -> rawData.[ n + " -" + string id] <- el.Value))
2109+ | lst -> lst |> List .iteri ( fun id el -> rawData.[ n + " -" + string id] <- el.Value))
20992110
21002111 let rawData = rawData |> Seq.toList
21012112
@@ -2756,9 +2767,9 @@ module internal SymbolReader =
27562767 // ----------------------------------------------------------------------------------------------
27572768
27582769 let stripMicrosoft ( str : string ) =
2759- if str.StartsWith( " Microsoft." ) then
2770+ if str.StartsWith( " Microsoft." , StringComparison.Ordinal ) then
27602771 str.[ " Microsoft." .Length ..]
2761- elif str.StartsWith( " microsoft-" ) then
2772+ elif str.StartsWith( " microsoft-" , StringComparison.Ordinal ) then
27622773 str.[ " microsoft-" .Length ..]
27632774 else
27642775 str
0 commit comments