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

Commit992a3d6

Browse files
chillitomdsyme
authored andcommitted
use index comparison instead of pointer comparison (#2976)
1 parent7e964bb commit992a3d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/fsharp/ConstraintSolver.fs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,9 +2363,10 @@ and ResolveOverloading
23632363

23642364

23652365
letbestMethods=
2366-
applicableMeths|> List.choose(fun candidate->
2367-
if applicableMeths|> List.forall(fun other->
2368-
p13 candidate=== p13 other||// REVIEW: change this needless use of pointer equality to be an index comparison
2366+
letindexedApplicableMeths= applicableMeths|> List.indexed
2367+
indexedApplicableMeths|> List.choose(fun(i,candidate)->
2368+
if indexedApplicableMeths|> List.forall(fun(j,other)->
2369+
i= j||
23692370
letres= better candidate other
23702371
//eprintfn "\n-------\nCandidate: %s\nOther: %s\nResult: %d\n" (NicePrint.stringOfMethInfo amap m denv (fst candidate).Method) (NicePrint.stringOfMethInfo amap m denv (fst other).Method) res
23712372
res>0)then

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp