Skip to content

Commit

Permalink
Code-style cleanups: remove redundant field inits (App-vNext#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored and reisenberger committed Nov 27, 2019
1 parent 3beb7da commit e370972
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Polly.Specs/Helpers/PolicyExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public static class PolicyExtensions
{
public class ExceptionAndOrCancellationScenario
{
public int NumberOfTimesToRaiseException = 0;
public int? AttemptDuringWhichToCancel = null;
public int NumberOfTimesToRaiseException;
public int? AttemptDuringWhichToCancel;
public bool ActionObservesCancellation = true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Polly.Specs/Helpers/PolicyExtensionsAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ public static class PolicyExtensionsAsync
{
public class ExceptionAndOrCancellationScenario
{
public int NumberOfTimesToRaiseException = 0;
public int NumberOfTimesToRaiseException;

public int? AttemptDuringWhichToCancel = null;
public int? AttemptDuringWhichToCancel;

public bool ActionObservesCancellation = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Polly.Specs/Timeout/TimeoutSpecsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public abstract class TimeoutSpecsBase : IDisposable
// xUnit creates a new class instance per test, so these variables are isolated per test.

// Track a CancellationTokenSource, and when it might be cancelled at.
private CancellationTokenSource _trackedTokenSource = null;
private CancellationTokenSource _trackedTokenSource;
private DateTimeOffset _cancelAt = DateTimeOffset.MaxValue;

private DateTimeOffset _offsetUtcNow = DateTimeOffset.UtcNow;
Expand Down
2 changes: 1 addition & 1 deletion src/Polly/Context.Dictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public partial class Context : IDictionary<string, object>, IDictionary, IReadOn
// For an individual execution through a policy or policywrap, it is expected that all execution steps (for example executing the user delegate, invoking policy-activity delegates such as onRetry, onBreak, onTimeout etc) execute sequentially.
// Therefore, this class is intentionally not constructed to be safe for concurrent access from multiple threads.

private Dictionary<string, object> wrappedDictionary = null;
private Dictionary<string, object> wrappedDictionary;

private Dictionary<string, object> WrappedDictionary => wrappedDictionary ?? (wrappedDictionary = new Dictionary<string, object>());

Expand Down

0 comments on commit e370972

Please sign in to comment.