Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mikernet committed Mar 4, 2024
1 parent 3a0c5b9 commit 4445b16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public CurrencyRegistry(string name, IEnumerable<Currency> 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)
Expand Down
8 changes: 4 additions & 4 deletions Source/Singulink.Globalization.Currency/SortedMoneySet.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Text;

namespace Singulink.Globalization;
Expand Down Expand Up @@ -188,7 +188,7 @@ public int RemoveAll(IEnumerable<Currency> currencies)
{
if (!_registry.Contains(currency))
{
disallowedCurrencies ??= new();
disallowedCurrencies ??= [];
disallowedCurrencies.Add(currency);
continue;
}
Expand All @@ -214,7 +214,7 @@ public int RemoveAll(Func<Money, bool> predicate)
var money = new Money(kvp.Value, kvp.Key);
if (predicate(money))
{
currenciesToRemove ??= new();
currenciesToRemove ??= [];
currenciesToRemove.Add(kvp.Key);
}
}
Expand Down Expand Up @@ -428,7 +428,7 @@ private void AddRangeInternal(IEnumerable<Money> values, bool ensureCurrenciesIn

if (ensureCurrenciesInRegistry && !_registry.Contains(currency))
{
disallowedCurrencies ??= new();
disallowedCurrencies ??= [];
disallowedCurrencies.Add(currency);
continue;
}
Expand Down

0 comments on commit 4445b16

Please sign in to comment.