Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Trivial] Simplify conditional expression #3711

Merged
merged 2 commits into from May 31, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -506,11 +506,7 @@ private void SubscribeToCoinEvents(CoinViewModel cvm)
SelectedAmount = selectedCoins.Sum(x => x.Amount);
IsAnyCoinSelected = selectedCoins.Any();

LabelExposeCommonOwnershipWarning = !DisplayCommonOwnershipWarning
? false
: selectedCoins
.Where(c => c.AnonymitySet == 1)
.Any(x => selectedCoins.Any(x => x.AnonymitySet > 1));
LabelExposeCommonOwnershipWarning = DisplayCommonOwnershipWarning && selectedCoins.Where(c => c.AnonymitySet == 1).Any(x => selectedCoins.Any(x => x.AnonymitySet > 1));
yahiheb marked this conversation as resolved.
Show resolved Hide resolved

SelectionChanged?.Invoke(this, null);
}
Expand Down
2 changes: 1 addition & 1 deletion WalletWasabi.Packager/Program.cs
Expand Up @@ -153,7 +153,7 @@ private static void WriteOnionsToConsole(HashSet<string> currentOnions)
{
var verString = userAgent.Substring(userAgent.IndexOf("Satoshi:") + 8, 4);
var ver = new Version(verString);
bool addToResult = currentOnions is null ? true : currentOnions.Contains(node.Name);
bool addToResult = currentOnions is null || currentOnions.Contains(node.Name);

if (ver >= new Version("0.16") && addToResult)
{
Expand Down
4 changes: 1 addition & 3 deletions WalletWasabi/Blockchain/Mempool/MempoolService.cs
Expand Up @@ -79,9 +79,7 @@ public bool TryGetFromBroadcastStore(uint256 transactionHash, out TransactionBro
var found = BroadcastStore.FirstOrDefault(x => x.TransactionId == transactionHash);
entry = found;

return found is null
? false
: true;
return !(found is null);
}
}

Expand Down
2 changes: 1 addition & 1 deletion WalletWasabi/Nito/Collections/Deque.cs
Expand Up @@ -408,7 +408,7 @@ int IList.Add(object value)

bool IList.Contains(object value)
{
return IsT(value) ? ((ICollection<T>)this).Contains((T)value) : false;
return IsT(value) && ((ICollection<T>)this).Contains((T)value);
}

int IList.IndexOf(object value)
Expand Down