Removal of the ansicurrSymbol variable. (dotnet/coreclr#7999)
authorvarocarbas <contact@customsolvers.com>
Sun, 6 Nov 2016 14:41:33 +0000 (15:41 +0100)
committerJan Kotas <jkotas@microsoft.com>
Sun, 6 Nov 2016 14:41:33 +0000 (06:41 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/8351597b3af6bf188eb328fe5e2b3b8eb979c831

src/coreclr/src/mscorlib/src/System/Number.cs

index d832f72..a4b88a9 100644 (file)
@@ -742,20 +742,10 @@ namespace System {
             string groupSep;                // group separator from NumberFormatInfo.
             string currSymbol = null;       // currency symbol from NumberFormatInfo.
 
-            // The alternative currency symbol used in ANSI codepage, that can not roundtrip between ANSI and Unicode.
-            // Currently, only ja-JP and ko-KR has non-null values (which is U+005c, backslash)
-            string ansicurrSymbol = null;   // currency symbol from NumberFormatInfo.
-
             Boolean parsingCurrency = false; 
             if ((options & NumberStyles.AllowCurrencySymbol) != 0) {
                 currSymbol = numfmt.CurrencySymbol;
 
-#if !FEATURE_COREFX_GLOBALIZATION
-                if (numfmt.ansiCurrencySymbol != null) {
-                    ansicurrSymbol = numfmt.ansiCurrencySymbol;
-                }
-#endif
-
                 // The idea here is to match the currency separators and on failure match the number separators to keep the perf of VB's IsNumeric fast.
                 // The values of decSep are setup to use the correct relevant separator (currency in the if part and decimal in the else part).
                 decSep = numfmt.CurrencyDecimalSeparator;
@@ -787,10 +777,9 @@ namespace System {
                                                state |= StateSign | StateParens;
                                                number.sign = true;
                                        }
-                                       else if ((currSymbol != null && (next = MatchChars(p, currSymbol)) != null) || (ansicurrSymbol != null && (next = MatchChars(p, ansicurrSymbol)) != null)) {
+                                       else if (currSymbol != null && (next = MatchChars(p, currSymbol)) != null) {
                                                state |= StateCurrency;
                                                currSymbol = null;  
-                                               ansicurrSymbol = null;  
                                                // We already found the currency symbol. There should not be more currency symbols. Set
                                                // currSymbol to NULL so that we won't search it again in the later code path.
                                                p = next - 1;
@@ -887,9 +876,8 @@ namespace System {
                                                else if (ch == ')' && ((state & StateParens) != 0)) {
                                                        state &= ~StateParens;
                                                }
-                                               else if ((currSymbol != null && (next = MatchChars(p, currSymbol)) != null) || (ansicurrSymbol != null && (next = MatchChars(p, ansicurrSymbol)) != null)) {
+                                               else if (currSymbol != null && (next = MatchChars(p, currSymbol)) != null) {
                                                        currSymbol = null;
-                                                       ansicurrSymbol = null;
                                                        p = next - 1;
                                                }
                                                else {