Skip to content

Commit

Permalink
Initialize _equalityComparer in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
FreePhoenix888 committed Jan 13, 2022
1 parent 11b75ef commit 6d6b351
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion csharp/Platform.Data/ReadHandlerState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ namespace Platform.Data
{
public struct ReadHandlerState<TLink>
{
private readonly EqualityComparer<TLink> _equalityComparer = EqualityComparer<TLink>.Default;
private readonly EqualityComparer<TLink> _equalityComparer;
public TLink Result;
public ReadHandler<TLink> Handler;
public TLink Continue;
public TLink Break;

public ReadHandlerState(TLink @continue, TLink @break, ReadHandler<TLink> handler)
{
_equalityComparer = EqualityComparer<TLink>.Default;
Continue = @continue;
Break = @break;
Result = @continue;
Expand Down
3 changes: 2 additions & 1 deletion csharp/Platform.Data/WriteHandlerState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ namespace Platform.Data
{
public struct WriteHandlerState<TLink>
{
private readonly EqualityComparer<TLink> _equalityComparer = EqualityComparer<TLink>.Default;
private readonly EqualityComparer<TLink> _equalityComparer;
public TLink Result;
public WriteHandler<TLink> Handler;
public TLink Continue;
public TLink Break;

public WriteHandlerState(TLink @continue, TLink @break, WriteHandler<TLink> handler)
{
_equalityComparer = EqualityComparer<TLink>.Default;
Continue = @continue;
Break = @break;
Result = @continue;
Expand Down

0 comments on commit 6d6b351

Please sign in to comment.