Remove some unnecessary checks
MODIFY
WalletWasabi.Gui/Behaviors/SuggestionBehavior.cs
WalletWasabi.Gui/Behaviors/SuggestionBehavior.cs
@@ -38,7 +38,7 @@ namespace WalletWasabi.Gui.Behaviors
HandleAutoUpdate();
e.Handled = true;
}
- if (e.Key == Key.Down)
+ else if (e.Key == Key.Down)
{
if (SuggestionItems != null)
{
@@ -69,7 +69,7 @@ namespace WalletWasabi.Gui.Behaviors
e.Handled = true;
}
}
- if (e.Key == Key.Up)
+ else if (e.Key == Key.Up)
{
if (SuggestionItems != null)
{
@@ -80,7 +80,7 @@ namespace WalletWasabi.Gui.Behaviors
e.Handled = true;
}
}
- if (e.Key == Key.Enter)
+ else if (e.Key == Key.Enter)
{
if (SuggestionItems != null)
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -551,7 +551,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
if (feeTarget == target)
{
- feeTarget = target;
break;
}
else if (feeTarget < target)

MODIFY
WalletWasabi/KeyManagement/KeyManager.cs
WalletWasabi/KeyManagement/KeyManager.cs
@@ -495,20 +495,29 @@ namespace WalletWasabi.KeyManagement
public IEnumerable<HdPubKey> GetKeys(KeyState? keyState = null, bool? isInternal = null)
{
- if (keyState is null && isInternal is null)
+ if (keyState is null)
+ {
+ if (isInternal is null)
{
return GetKeys(x => true);
}
- if (isInternal is null && keyState != null)
+ else
{
- return GetKeys(x => x.KeyState == keyState);
+ return GetKeys(x => x.IsInternal == isInternal);
+ }
}
- else if (keyState is null)
+ else
{
- return GetKeys(x => x.IsInternal == isInternal);
+ if (isInternal is null)
+ {
+ return GetKeys(x => x.KeyState == keyState);
}
+ else
+ {
return GetKeys(x => x.IsInternal == isInternal && x.KeyState == keyState);
}
+ }
+ }
public IEnumerable<byte[]> GetPubKeyScriptBytes()
{

Remove some unnecessary checks