From 6efb990b48f729453967410f535017672e369ed1 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Fri, 16 Feb 2024 22:06:56 +1100 Subject: [PATCH] remove duplicate dictionary lookup (#1361) --- .../NumberToWords/FinnishNumberToWordsConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Humanizer/Localisation/NumberToWords/FinnishNumberToWordsConverter.cs b/src/Humanizer/Localisation/NumberToWords/FinnishNumberToWordsConverter.cs index 2db4f1cf1..e89602574 100644 --- a/src/Humanizer/Localisation/NumberToWords/FinnishNumberToWordsConverter.cs +++ b/src/Humanizer/Localisation/NumberToWords/FinnishNumberToWordsConverter.cs @@ -87,9 +87,9 @@ public override string Convert(long input) private static string GetOrdinalUnit(int number, bool useExceptions) { - if (useExceptions && OrdinalExceptions.ContainsKey(number)) + if (useExceptions && OrdinalExceptions.TryGetValue(number, out var unit)) { - return OrdinalExceptions[number]; + return unit; } return OrdinalUnitsMap[number];