forked from WalletWasabi/WalletWasabi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request WalletWasabi#13175 from SuperJMN/fixes/fetch-usages
[UI] Review EditDiff usages
- Loading branch information
Showing
9 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
namespace WalletWasabi.Fluent.Helpers; | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
public class LambdaComparer<T> : IEqualityComparer<T> | ||
{ | ||
private readonly Func<T?, T?, bool> _lambdaComparer; | ||
private readonly Func<T?, int> _lambdaHash; | ||
|
||
public LambdaComparer(Func<T?, T?, bool> lambdaComparer) : | ||
this(lambdaComparer, _ => 0) | ||
{ | ||
} | ||
|
||
public LambdaComparer(Func<T?, T?, bool> lambdaComparer, Func<T?, int> lambdaHash) | ||
{ | ||
_lambdaComparer = lambdaComparer ?? throw new ArgumentNullException("lambdaComparer"); | ||
_lambdaHash = lambdaHash ?? throw new ArgumentNullException("lambdaHash"); | ||
} | ||
|
||
public bool Equals(T? x, T? y) | ||
{ | ||
return _lambdaComparer(x, y); | ||
} | ||
|
||
public int GetHashCode(T obj) | ||
{ | ||
return _lambdaHash(obj); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters