Skip to content

Commit 5757164

Browse files
Merge pull request #1 from forki/optimizations
Reduce allocations futher
2 parents a23a52c + 32673e4 commit 5757164

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/fsharp/tast.fs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4424,12 +4424,10 @@ let primUnionCaseRefEq compilingFslib fslibCcu (UCRef(tcr1,c1) as uc1) (UCRef(tc
44244424
/// Note this routine doesn't take type forwarding into account
44254425
let primValRefEq compilingFslib fslibCcu (x : ValRef) (y : ValRef) =
44264426
x === y ||
4427-
match x.IsResolved,y.IsResolved with
4428-
| true, true when x.ResolvedTarget === y.ResolvedTarget -> true
4429-
| _ ->
4430-
match x.IsLocalRef,y.IsLocalRef with
4431-
| true,true when valEq x.PrivateTarget y.PrivateTarget -> true
4432-
| _ ->
4427+
if (x.IsResolved && y.IsResolved && x.ResolvedTarget === y.ResolvedTarget) ||
4428+
(x.IsLocalRef && y.IsLocalRef && valEq x.PrivateTarget y.PrivateTarget) then
4429+
true
4430+
else
44334431
(// Use TryDeref to guard against the platforms/times when certain F# language features aren't available,
44344432
// e.g. CompactFramework doesn't have support for quotations.
44354433
let v1 = x.TryDeref

0 commit comments

Comments
 (0)