Reduced code by using object initializer
MODIFY
WalletWasabi.Gui/Program.cs
WalletWasabi.Gui/Program.cs
@@ -41,8 +41,7 @@ namespace WalletWasabi.Gui
BuildAvaloniaApp()
.BeforeStarting(async builder =>
{
- MainWindowViewModel.Instance = new MainWindowViewModel();
- MainWindowViewModel.Instance.Global = Global;
+ MainWindowViewModel.Instance = new MainWindowViewModel { Global = Global };
statusBar = new StatusBarViewModel(Global);
MainWindowViewModel.Instance.StatusBar = statusBar;

MODIFY
WalletWasabi/Helpers/NBitcoinHelpers.cs
WalletWasabi/Helpers/NBitcoinHelpers.cs
@@ -118,8 +118,7 @@ namespace WalletWasabi.Helpers
throw new FormatException("Invalid address manager file");
}
- BitcoinStream stream = new BitcoinStream(data);
- stream.Type = SerializationType.Disk;
+ BitcoinStream stream = new BitcoinStream(data) { Type = SerializationType.Disk };
uint magic = 0;
stream.ReadWrite(ref magic);
if (expectedNetwork != null && expectedNetwork.Magic != magic)

MODIFY
WalletWasabi/Nito/AsyncEx/AsyncMutex.cs
WalletWasabi/Nito/AsyncEx/AsyncMutex.cs
@@ -290,9 +290,8 @@ namespace Nito.AsyncEx
throw new InvalidOperationException($"Thread should not be alive.");
}
- MutexThread = new Thread(new ParameterizedThreadStart(HoldLock));
+ MutexThread = new Thread(new ParameterizedThreadStart(HoldLock)) { Name = $"MutexThread" };
- MutexThread.Name = $"MutexThread";
MutexThread.Start(cancellationToken);

Reduced code by using object initializer