Skip to content

Commit e335808

Browse files
committed
address PR feedback, use a literal for better codegen and code quality, same perf
1 parent c9d61ea commit e335808

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/LengthConverter.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static internal double FromString(string s, CultureInfo cultureInfo)
182182
//Auto is represented as Double.NaN
183183
//properties that do not want Auto and NaN to be in their ligit values,
184184
//should disallow NaN in validation callbacks (same goes for negative values)
185-
if (valueString.Equals(NaNValue, StringComparison.OrdinalIgnoreCase))
185+
if (valueString.Equals("Auto", StringComparison.OrdinalIgnoreCase))
186186
return double.NaN;
187187

188188
for (int i = 0; i < s_pixelUnitStrings.Length; i++)
@@ -227,9 +227,6 @@ static internal double FromString(string s, CultureInfo cultureInfo)
227227
96.0 / 72.0, // pt - Pixels per Point
228228
];
229229

230-
/// <summary> Holds the "Auto" string representation for <see cref="double"/> conversion. </summary>
231-
private static ReadOnlySpan<char> NaNValue => ['A', 'u', 't', 'o'];
232-
233230
static internal string ToString(double l, CultureInfo cultureInfo)
234231
{
235232
if(double.IsNaN(l)) return "Auto";

0 commit comments

Comments
 (0)