Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove some un-used parameters #1367

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Humanizer/Configuration/LocaliserRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class LocaliserRegistry<TLocaliser>
/// Creates a localiser registry with the default localiser set to the provided value
/// </summary>
public LocaliserRegistry(TLocaliser defaultLocaliser) =>
_defaultLocaliser = (culture) => defaultLocaliser;
_defaultLocaliser = _ => defaultLocaliser;

/// <summary>
/// Creates a localiser registry with the default localiser factory set to the provided value
Expand All @@ -39,7 +39,7 @@ public class LocaliserRegistry<TLocaliser>
/// Registers the localiser for the culture provided
/// </summary>
public void Register(string localeCode, TLocaliser localiser) =>
_localisers[localeCode] = (culture) => localiser;
_localisers[localeCode] = _ => localiser;

/// <summary>
/// Registers the localiser factory for the culture provided
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
internal class NumberToWordsConverterRegistry : LocaliserRegistry<INumberToWordsConverter>
{
public NumberToWordsConverterRegistry()
: base((culture) => new EnglishNumberToWordsConverter())
: base(_ => new EnglishNumberToWordsConverter())
{
Register("af", new AfrikaansNumberToWordsConverter());
Register("en", new EnglishNumberToWordsConverter());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ private static List<int> SplitEveryThreeDigits(int number)
/// </summary>
/// <param name="number">The three-digit set to convert.</param>
/// <param name="gender">The grammatical gender to convert to.</param>
/// <param name="thisIsLastSet">True if the current three-digit set is the last in the word.</param>
/// <returns>The same three-digit set expressed as text.</returns>
private string ThreeDigitSetConverter(int number, GrammaticalGender gender, bool thisIsLastSet = false)
private string ThreeDigitSetConverter(int number, GrammaticalGender gender)
{
if (number == 0)
{
Expand Down Expand Up @@ -292,7 +291,7 @@ private string HundredsToText(int hundreds)
/// <param name="gender">The grammatical gender to convert to.</param>
/// <returns>The same three-digit number, as units, expressed as text.</returns>
private string UnitsConverter(int number, GrammaticalGender gender) =>
ThreeDigitSetConverter(number, gender, true);
ThreeDigitSetConverter(number, gender);

/// <summary>
/// Converts a thousands three-digit number to text.
Expand Down Expand Up @@ -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";
}
}

Expand Down