From 4445b16c62a335165003f99751d15e01701156f0 Mon Sep 17 00:00:00 2001 From: Mike Marynowski Date: Mon, 4 Mar 2024 01:20:39 -0500 Subject: [PATCH] Cleanup --- .../Singulink.Globalization.Currency/CurrencyRegistry.cs | 2 +- Source/Singulink.Globalization.Currency/SortedMoneySet.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Singulink.Globalization.Currency/CurrencyRegistry.cs b/Source/Singulink.Globalization.Currency/CurrencyRegistry.cs index 4df4329..8754c2f 100644 --- a/Source/Singulink.Globalization.Currency/CurrencyRegistry.cs +++ b/Source/Singulink.Globalization.Currency/CurrencyRegistry.cs @@ -28,7 +28,7 @@ public CurrencyRegistry(string name, IEnumerable currencies) if (_name.Length == 0) throw new ArgumentException("Name is required.", nameof(name)); - _currencies = new(); + _currencies = []; _currencyLookup = new(StringComparer.OrdinalIgnoreCase); foreach (var currency in currencies) diff --git a/Source/Singulink.Globalization.Currency/SortedMoneySet.cs b/Source/Singulink.Globalization.Currency/SortedMoneySet.cs index ed23659..9a0bdc5 100644 --- a/Source/Singulink.Globalization.Currency/SortedMoneySet.cs +++ b/Source/Singulink.Globalization.Currency/SortedMoneySet.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Text; namespace Singulink.Globalization; @@ -188,7 +188,7 @@ public int RemoveAll(IEnumerable currencies) { if (!_registry.Contains(currency)) { - disallowedCurrencies ??= new(); + disallowedCurrencies ??= []; disallowedCurrencies.Add(currency); continue; } @@ -214,7 +214,7 @@ public int RemoveAll(Func predicate) var money = new Money(kvp.Value, kvp.Key); if (predicate(money)) { - currenciesToRemove ??= new(); + currenciesToRemove ??= []; currenciesToRemove.Add(kvp.Key); } } @@ -428,7 +428,7 @@ private void AddRangeInternal(IEnumerable values, bool ensureCurrenciesIn if (ensureCurrenciesInRegistry && !_registry.Contains(currency)) { - disallowedCurrencies ??= new(); + disallowedCurrencies ??= []; disallowedCurrencies.Add(currency); continue; }