Skip to content

Commit

Permalink
Merge pull request #1 from forki/optimizations
Browse files Browse the repository at this point in the history
Reduce allocations futher
  • Loading branch information
vasily-kirichenko committed May 21, 2016
2 parents a23a52c + 32673e4 commit 5757164
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/fsharp/tast.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4424,12 +4424,10 @@ let primUnionCaseRefEq compilingFslib fslibCcu (UCRef(tcr1,c1) as uc1) (UCRef(tc
/// Note this routine doesn't take type forwarding into account
let primValRefEq compilingFslib fslibCcu (x : ValRef) (y : ValRef) =
x === y ||
match x.IsResolved,y.IsResolved with
| true, true when x.ResolvedTarget === y.ResolvedTarget -> true
| _ ->
match x.IsLocalRef,y.IsLocalRef with
| true,true when valEq x.PrivateTarget y.PrivateTarget -> true
| _ ->
if (x.IsResolved && y.IsResolved && x.ResolvedTarget === y.ResolvedTarget) ||
(x.IsLocalRef && y.IsLocalRef && valEq x.PrivateTarget y.PrivateTarget) then
true
else
(// Use TryDeref to guard against the platforms/times when certain F# language features aren't available,
// e.g. CompactFramework doesn't have support for quotations.
let v1 = x.TryDeref
Expand Down

0 comments on commit 5757164

Please sign in to comment.