From 3307554a09017a45db43159b2162ce89090d0d18 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Fri, 16 Feb 2024 22:36:33 +1100 Subject: [PATCH] remove some un-used parameters --- src/Humanizer/Configuration/LocaliserRegistry.cs | 4 ++-- .../Configuration/NumberToWordsConverterRegistry.cs | 2 +- .../Romanian/RomanianCardinalNumberConverter.cs | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Humanizer/Configuration/LocaliserRegistry.cs b/src/Humanizer/Configuration/LocaliserRegistry.cs index 8d15b135f..5d31d8dd6 100644 --- a/src/Humanizer/Configuration/LocaliserRegistry.cs +++ b/src/Humanizer/Configuration/LocaliserRegistry.cs @@ -14,7 +14,7 @@ public class LocaliserRegistry /// Creates a localiser registry with the default localiser set to the provided value /// public LocaliserRegistry(TLocaliser defaultLocaliser) => - _defaultLocaliser = (culture) => defaultLocaliser; + _defaultLocaliser = _ => defaultLocaliser; /// /// Creates a localiser registry with the default localiser factory set to the provided value @@ -39,7 +39,7 @@ public TLocaliser ResolveForCulture(CultureInfo culture) => /// Registers the localiser for the culture provided /// public void Register(string localeCode, TLocaliser localiser) => - _localisers[localeCode] = (culture) => localiser; + _localisers[localeCode] = _ => localiser; /// /// Registers the localiser factory for the culture provided diff --git a/src/Humanizer/Configuration/NumberToWordsConverterRegistry.cs b/src/Humanizer/Configuration/NumberToWordsConverterRegistry.cs index ad58c8058..1da4ed43c 100644 --- a/src/Humanizer/Configuration/NumberToWordsConverterRegistry.cs +++ b/src/Humanizer/Configuration/NumberToWordsConverterRegistry.cs @@ -3,7 +3,7 @@ internal class NumberToWordsConverterRegistry : LocaliserRegistry { public NumberToWordsConverterRegistry() - : base((culture) => new EnglishNumberToWordsConverter()) + : base(_ => new EnglishNumberToWordsConverter()) { Register("af", new AfrikaansNumberToWordsConverter()); Register("en", new EnglishNumberToWordsConverter()); diff --git a/src/Humanizer/Localisation/NumberToWords/Romanian/RomanianCardinalNumberConverter.cs b/src/Humanizer/Localisation/NumberToWords/Romanian/RomanianCardinalNumberConverter.cs index 62cdb7744..9d51e5789 100644 --- a/src/Humanizer/Localisation/NumberToWords/Romanian/RomanianCardinalNumberConverter.cs +++ b/src/Humanizer/Localisation/NumberToWords/Romanian/RomanianCardinalNumberConverter.cs @@ -194,9 +194,8 @@ private Func GetNextPartConverter(ThreeDigitSets /// /// The three-digit set to convert. /// The grammatical gender to convert to. - /// True if the current three-digit set is the last in the word. /// The same three-digit set expressed as text. - private string ThreeDigitSetConverter(int number, GrammaticalGender gender, bool thisIsLastSet = false) + private string ThreeDigitSetConverter(int number, GrammaticalGender gender) { if (number == 0) { @@ -292,7 +291,7 @@ private string HundredsToText(int hundreds) /// The grammatical gender to convert to. /// The same three-digit number, as units, expressed as text. private string UnitsConverter(int number, GrammaticalGender gender) => - ThreeDigitSetConverter(number, gender, true); + ThreeDigitSetConverter(number, gender); /// /// Converts a thousands three-digit number to text. @@ -346,7 +345,7 @@ private string MillionsConverter(int number, GrammaticalGender gender) } else { - return ThreeDigitSetConverter(number, GrammaticalGender.Feminine, true) + (IsAbove20(number) ? " " + _joinAbove20 : string.Empty) + " milioane"; + return ThreeDigitSetConverter(number, GrammaticalGender.Feminine) + (IsAbove20(number) ? " " + _joinAbove20 : string.Empty) + " milioane"; } }