@@ -63,22 +63,21 @@ internal List<string> GetAbbreviationsForUnit(int unit)
63
63
64
64
internal List < int > GetUnitsForAbbreviation ( string abbreviation )
65
65
{
66
- abbreviation = abbreviation . ToLower ( ) ;
67
- if ( ! abbreviationToUnitMap . TryGetValue ( abbreviation , out var units ) )
68
- abbreviationToUnitMap [ abbreviation ] = units = new List < int > ( ) ;
66
+ var lowerCaseAbbreviation = abbreviation . ToLower ( ) ;
67
+ if ( ! abbreviationToUnitMap . TryGetValue ( lowerCaseAbbreviation , out var units ) )
68
+ abbreviationToUnitMap [ lowerCaseAbbreviation ] = units = new List < int > ( ) ;
69
69
70
70
return units . Distinct ( ) . ToList ( ) ;
71
71
}
72
72
73
73
internal void Add ( int unit , string abbreviation , bool setAsDefault = false )
74
74
{
75
- // abbreviation = abbreviation.ToLower();
76
- var lower = abbreviation . ToLower ( ) ;
75
+ var lowerCaseAbbreviation = abbreviation . ToLower ( ) ;
77
76
if ( ! unitToAbbreviationMap . TryGetValue ( unit , out var abbreviationsForUnit ) )
78
77
abbreviationsForUnit = unitToAbbreviationMap [ unit ] = new List < string > ( ) ;
79
78
80
- if ( ! abbreviationToUnitMap . TryGetValue ( lower , out var unitsForAbbreviation ) )
81
- abbreviationToUnitMap [ lower ] = unitsForAbbreviation = new List < int > ( ) ;
79
+ if ( ! abbreviationToUnitMap . TryGetValue ( lowerCaseAbbreviation , out var unitsForAbbreviation ) )
80
+ abbreviationToUnitMap [ lowerCaseAbbreviation ] = unitsForAbbreviation = new List < int > ( ) ;
82
81
83
82
abbreviationsForUnit . Remove ( abbreviation ) ;
84
83
unitsForAbbreviation . Remove ( unit ) ;
0 commit comments