Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf0e945c

Browse files
forkiKevinRansom
authored andcommitted
Compute indexed List only once (dotnet#2269)
1 parent44514f3 commitf0e945c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/fsharp/TypeChecker.fs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4793,8 +4793,9 @@ and CrackStaticConstantArgs cenv env tpenv (staticParameters: Tainted<ProvidedPa
47934793
if not otherArgs.IsEmpty then
47944794
error (Error(FSComp.SR.etBadUnnamedStaticArgs(),m))
47954795

4796+
let indexedStaticParameters = staticParameters |> Array.toList |> List.indexed
47964797
for (n,_) in namedArgs do
4797-
matchstaticParameters |> Array.toList |> List.mapi (fun j x -> (j,x)) |> List.filter (fun (j,sp) -> j >= unnamedArgs.Length && n.idText = sp.PUntaint((fun sp -> sp.Name), m)) with
4798+
matchindexedStaticParameters |> List.filter (fun (j,sp) -> j >= unnamedArgs.Length && n.idText = sp.PUntaint((fun sp -> sp.Name), m)) with
47984799
| [] ->
47994800
if staticParameters |> Array.exists (fun sp -> n.idText = sp.PUntaint((fun sp -> sp.Name), n.idRange)) then
48004801
error (Error(FSComp.SR.etStaticParameterAlreadyHasValue n.idText,n.idRange))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp