Skip to content

Commit

Permalink
Remove unnecessary reference copies
Browse files Browse the repository at this point in the history
Originally copied from java where such things are required.

Fixes #517
  • Loading branch information
kjnilsson committed Sep 6, 2019
1 parent a37a32a commit fd45158
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,10 @@ public void BeginAutomaticRecovery()
if (!performingRecovery)
{
performingRecovery = true;
var self = this;

recoveryTaskFactory.StartNew(() =>
{
if (!self.ManuallyClosed)
if (!this.ManuallyClosed)
{
try
{
Expand All @@ -375,7 +374,7 @@ public void BeginAutomaticRecovery()
#else
Thread.Sleep(m_factory.NetworkRecoveryInterval);
#endif
self.PerformAutomaticRecovery();
this.PerformAutomaticRecovery();
}
finally
{
Expand Down Expand Up @@ -598,7 +597,6 @@ private void Init(IFrameHandler fh)
m_delegate = new Connection(m_factory, false,
fh, this.ClientProvidedName);

AutorecoveringConnection self = this;
EventHandler<ShutdownEventArgs> recoveryListener = (_, args) =>
{
lock (recoveryLockTarget)
Expand All @@ -607,7 +605,7 @@ private void Init(IFrameHandler fh)
{
try
{
self.BeginAutomaticRecovery();
this.BeginAutomaticRecovery();
}
catch (Exception e)
{
Expand Down

0 comments on commit fd45158

Please sign in to comment.