Cleanup dead code under undefined constants (#39155)
authorAdeel Mujahid <adeelbm@outlook.com>
Sun, 12 Jul 2020 20:29:15 +0000 (23:29 +0300)
committerGitHub <noreply@github.com>
Sun, 12 Jul 2020 20:29:15 +0000 (16:29 -0400)
13 files changed:
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableExtensions.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriter.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWriterSettings.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs
src/libraries/System.Private.Xml/src/System/Xml/ValidateNames.cs
src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathScanner.cs
src/libraries/System.Private.Xml/src/System/Xml/XmlConvert.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathScanner.cs
src/libraries/System.Threading.Tasks.Parallel/src/System.Threading.Tasks.Parallel.csproj

index 42a10fc..34b40e4 100644 (file)
@@ -34,131 +34,6 @@ namespace System.Collections.Immutable
 #endif
         }
 
-#if EqualsStructurally
-
-        /// <summary>
-        /// An optimized version of <see cref="Enumerable.SequenceEqual{T}(IEnumerable{T}, IEnumerable{T}, IEqualityComparer{T})"/>
-        /// that allows nulls, considers reference equality and count before beginning the enumeration.
-        /// </summary>
-        /// <typeparam name="T">The type of elements in the sequence.</typeparam>
-        /// <param name="sequence1">The first sequence.</param>
-        /// <param name="sequence2">The second sequence.</param>
-        /// <param name="equalityComparer">The equality comparer to use for the elements.</param>
-        /// <returns><c>true</c> if the sequences are equal (same elements in the same order); <c>false</c> otherwise.</returns>
-        internal static bool CollectionEquals<T>(this IEnumerable<T> sequence1, IEnumerable<T> sequence2, IEqualityComparer<T> equalityComparer = null)
-        {
-            if (sequence1 == sequence2)
-            {
-                return true;
-            }
-
-            if ((sequence1 == null) ^ (sequence2 == null))
-            {
-                return false;
-            }
-
-            int count1, count2;
-            if (sequence1.TryGetCount(out count1) && sequence2.TryGetCount(out count2))
-            {
-                if (count1 != count2)
-                {
-                    return false;
-                }
-
-                if (count1 == 0 && count2 == 0)
-                {
-                    return true;
-                }
-            }
-
-            return sequence1.SequenceEqual(sequence2, equalityComparer);
-        }
-
-        /// <summary>
-        /// An optimized version of <see cref="Enumerable.SequenceEqual{T}(IEnumerable{T}, IEnumerable{T}, IEqualityComparer{T})"/>
-        /// that allows nulls, considers reference equality and count before beginning the enumeration.
-        /// </summary>
-        /// <typeparam name="T">The type of elements in the sequence.</typeparam>
-        /// <param name="sequence1">The first sequence.</param>
-        /// <param name="sequence2">The second sequence.</param>
-        /// <param name="equalityComparer">The equality comparer to use for the elements.</param>
-        /// <returns><c>true</c> if the sequences are equal (same elements in the same order); <c>false</c> otherwise.</returns>
-        internal static bool CollectionEquals<T>(this IEnumerable<T> sequence1, IEnumerable sequence2, IEqualityComparer equalityComparer = null)
-        {
-            if (sequence1 == sequence2)
-            {
-                return true;
-            }
-
-            if ((sequence1 == null) ^ (sequence2 == null))
-            {
-                return false;
-            }
-
-            int count1, count2;
-            if (sequence1.TryGetCount(out count1) && sequence2.TryGetCount<T>(out count2))
-            {
-                if (count1 != count2)
-                {
-                    return false;
-                }
-
-                if (count1 == 0 && count2 == 0)
-                {
-                    return true;
-                }
-            }
-
-            if (equalityComparer == null)
-            {
-                equalityComparer = EqualityComparer<T>.Default;
-            }
-
-            // If we have generic types we can use, use them to avoid boxing.
-            var sequence2OfT = sequence2 as IEnumerable<T>;
-            var equalityComparerOfT = equalityComparer as IEqualityComparer<T>;
-            if (sequence2OfT != null && equalityComparerOfT != null)
-            {
-                return sequence1.SequenceEqual(sequence2OfT, equalityComparerOfT);
-            }
-            else
-            {
-                // We have to fall back to doing it manually since the underlying collection
-                // being compared isn't a (matching) generic type.
-                using (var enumerator = sequence1.GetEnumerator())
-                {
-                    var enumerator2 = sequence2.GetEnumerator();
-                    try
-                    {
-                        while (enumerator.MoveNext())
-                        {
-                            if (!enumerator2.MoveNext() || !equalityComparer.Equals(enumerator.Current, enumerator2.Current))
-                            {
-                                return false;
-                            }
-                        }
-
-                        if (enumerator2.MoveNext())
-                        {
-                            return false;
-                        }
-
-                        return true;
-                    }
-                    finally
-                    {
-                        var enum2Disposable = enumerator2 as IDisposable;
-                        if (enum2Disposable != null)
-                        {
-                            enum2Disposable.Dispose();
-                        }
-                    }
-                }
-            }
-        }
-
-#endif
-
         /// <summary>
         /// Provides a known wrapper around a sequence of elements that provides the number of elements
         /// and an indexer into its contents.
index c381af8..781e361 100644 (file)
@@ -412,16 +412,6 @@ namespace System.Runtime.Serialization
                         _ilg.StoreMember(dataMember.MemberInfo);
                     }
 
-#if FEATURE_LEGACYNETCF
-                    // The DataContractSerializer in the .NET Framework doesn't support unordered elements:
-                    // deserialization will fail if the data members in the XML are not sorted alphabetically.
-                    // But the NetCF DataContractSerializer does support unordered element. To maintain compatibility
-                    // with Mango we always search for the member from the beginning of the member list.
-                    // We set memberIndexLocal to -1 because GetMemberIndex always starts from memberIndex+1.
-                    if (CompatibilitySwitches.IsAppEarlierThanWindowsPhone8)
-                        ilg.Set(memberIndexLocal, (int)-1);
-                    else
-#endif // FEATURE_LEGACYNETCF
                     _ilg.Set(memberIndexLocal, memberCount);
 
                     _ilg.EndCase();
index 7d8db42..75ad0dd 100644 (file)
@@ -3708,11 +3708,7 @@ namespace System.Xml
             }
 
             if (!XmlConvert.StrEqual(_ps.chars, _ps.charPos, 5, XmlDeclarationBeginning) ||
-                 _xmlCharType.IsNameSingleChar(_ps.chars![_ps.charPos + 5])
-#if XML10_FIFTH_EDITION
-                 || xmlCharType.IsNCNameHighSurrogateChar( ps.chars[ps.charPos + 5] )
-#endif
-                )
+                 _xmlCharType.IsNameSingleChar(_ps.chars![_ps.charPos + 5]))
             {
                 goto NoXmlDecl;
             }
@@ -3905,18 +3901,9 @@ namespace System.Xml
                     {
                         // version
                         case 0:
-#if XML10_FIFTH_EDITION
-                            //  VersionNum ::= '1.' [0-9]+   (starting with XML Fifth Edition)
-                            if (pos - ps.charPos >= 3 &&
-                                 ps.chars[ps.charPos] == '1' &&
-                                 ps.chars[ps.charPos + 1] == '.' &&
-                                 XmlCharType.IsOnlyDigits(ps.chars, ps.charPos + 2, pos - ps.charPos - 2))
-                            {
-#else
                             // VersionNum  ::=  '1.0'        (XML Fourth Edition and earlier)
                             if (XmlConvert.StrEqual(_ps.chars, _ps.charPos, pos - _ps.charPos, "1.0"))
                             {
-#endif
                                 if (!isTextDecl)
                                 {
                                     Debug.Assert(attr != null);
@@ -4022,14 +4009,6 @@ namespace System.Xml
         private bool ParseDocumentContent()
         {
             bool mangoQuirks = false;
-#if FEATURE_LEGACYNETCF
-            // In Mango the default XmlTextReader is instantiated
-            // with v1Compat flag set to true.  One of the effects
-            // of this settings is to eat any trailing nulls in the
-            // buffer and some apps depend on this behavior.
-            if (CompatibilitySwitches.IsAppEarlierThanWindowsPhone8)
-                mangoQuirks = true;
-#endif
             while (true)
             {
                 bool needMoreChars = false;
@@ -4457,12 +4436,6 @@ namespace System.Xml
             {
                 pos++;
             }
-#if XML10_FIFTH_EDITION
-            else if (pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], chars[pos]))
-            {
-                pos += 2;
-            }
-#endif
             else
             {
                 goto ParseQNameSlow;
@@ -4476,12 +4449,6 @@ namespace System.Xml
                 {
                     pos++;
                 }
-#if XML10_FIFTH_EDITION
-                else if (pos < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], chars[pos]))
-                {
-                    pos += 2;
-                }
-#endif
                 else
                 {
                     break;
@@ -4741,11 +4708,7 @@ namespace System.Xml
                     goto ReadData;
                 }
 
-                if (_xmlCharType.IsNCNameSingleChar(chars[pos]) || (chars[pos] == ':')
-#if XML10_FIFTH_EDITION
-                        || xmlCharType.IsNCNameHighSurrogateChar(chars[pos])
-#endif
-                    )
+                if (_xmlCharType.IsNCNameSingleChar(chars[pos]) || (chars[pos] == ':'))
                 {
                     ThrowTagMismatch(startTagNode);
                 }
@@ -4888,12 +4851,6 @@ namespace System.Xml
                 {
                     startNameCharSize = 1;
                 }
-#if XML10_FIFTH_EDITION
-                else if (pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], tmpch1))
-                {
-                    startNameCharSize = 2;
-                }
-#endif
 
                 if (startNameCharSize == 0)
                 {
@@ -4966,12 +4923,6 @@ namespace System.Xml
                     {
                         pos++;
                     }
-#if XML10_FIFTH_EDITION
-                    else if (pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], tmpch2))
-                    {
-                        pos += 2;
-                    }
-#endif
                     else
                     {
                         break;
@@ -5003,12 +4954,6 @@ namespace System.Xml
                             pos++;
                             goto ContinueParseName;
                         }
-#if XML10_FIFTH_EDITION
-                        else if ( pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar( chars[pos + 1], chars[pos] ) ) {
-                            pos += 2;
-                            goto ContinueParseName;
-                        }
-#endif
                         // else fallback to full name parsing routine
                         pos = ParseQName(out colonPos);
                         chars = _ps.chars;
@@ -7730,12 +7675,6 @@ namespace System.Xml
             {
                 pos++;
             }
-#if XML10_FIFTH_EDITION
-            else if (pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], chars[pos]))
-            {
-                pos += 2;
-            }
-#endif
             else
             {
                 if (pos + 1 >= _ps.charsUsed)
@@ -7760,11 +7699,6 @@ namespace System.Xml
                 {
                     pos++;
                 }
-#if XML10_FIFTH_EDITION
-                else if ( pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar( chars[pos + 1], chars[pos] ) ) {
-                    pos += 2;
-                }
-#endif
                 else
                 {
                     break;
@@ -7792,11 +7726,7 @@ namespace System.Xml
                 }
             }
             // end of buffer
-            else if (pos == _ps.charsUsed
-#if XML10_FIFTH_EDITION
-                || ( pos + 1 == ps.charsUsed && xmlCharType.IsNCNameHighSurrogateChar( chars[pos] ) )
-#endif
-                )
+            else if (pos == _ps.charsUsed)
             {
                 if (ReadDataInName(ref pos))
                 {
index 0b34bed..ad012c1 100644 (file)
@@ -1247,11 +1247,7 @@ namespace System.Xml
             }
 
             if (!XmlConvert.StrEqual(_ps.chars, _ps.charPos, 5, XmlDeclarationBeginning) ||
-                 _xmlCharType.IsNameSingleChar(_ps.chars[_ps.charPos + 5])
-#if XML10_FIFTH_EDITION
-                 || xmlCharType.IsNCNameHighSurrogateChar( ps.chars[ps.charPos + 5])
-#endif
-                )
+                 _xmlCharType.IsNameSingleChar(_ps.chars[_ps.charPos + 5]))
             {
                 goto NoXmlDecl;
             }
@@ -1441,17 +1437,9 @@ namespace System.Xml
                     {
                         // version
                         case 0:
-#if XML10_FIFTH_EDITION
-                            //  VersionNum ::= '1.' [0-9]+   (starting with XML Fifth Edition)
-                            if ( pos - ps.charPos >= 3 &&
-                                 ps.chars[ps.charPos] == '1' &&
-                                 ps.chars[ps.charPos + 1] == '.' &&
-                                 XmlCharType.IsOnlyDigits( ps.chars, ps.charPos + 2, pos - ps.charPos - 2 )) {
-#else
                             // VersionNum  ::=  '1.0'        (XML Fourth Edition and earlier)
                             if (XmlConvert.StrEqual(_ps.chars, _ps.charPos, pos - _ps.charPos, "1.0"))
                             {
-#endif
                                 if (!isTextDecl)
                                 {
                                     attr!.SetValue(_ps.chars, _ps.charPos, pos - _ps.charPos);
@@ -1956,12 +1944,6 @@ namespace System.Xml
             {
                 pos++;
             }
-
-#if XML10_FIFTH_EDITION
-            else if ( pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], chars[pos])) {
-                pos += 2;
-            }
-#endif
             else
             {
                 goto ParseQNameSlow;
@@ -1975,12 +1957,6 @@ namespace System.Xml
                 {
                     pos++;
                 }
-
-#if XML10_FIFTH_EDITION
-                else if ( pos < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], chars[pos])) {
-                    pos += 2;
-                }
-#endif
                 else
                 {
                     break;
@@ -2294,11 +2270,7 @@ namespace System.Xml
 
                 bool tagMismatch = false;
 
-                if (_xmlCharType.IsNCNameSingleChar(chars[pos]) || (chars[pos] == ':')
-#if XML10_FIFTH_EDITION
-                        || xmlCharType.IsNCNameHighSurrogateChar(chars[pos])
-#endif
-)
+                if (_xmlCharType.IsNCNameSingleChar(chars[pos]) || (chars[pos] == ':'))
                 {
                     tagMismatch = true;
                 }
@@ -2457,11 +2429,6 @@ namespace System.Xml
                 {
                     startNameCharSize = 1;
                 }
-#if XML10_FIFTH_EDITION
-                else if ( pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], tmpch1 )) {
-                    startNameCharSize = 2;
-                }
-#endif
 
                 if (startNameCharSize == 0)
                 {
@@ -2534,11 +2501,6 @@ namespace System.Xml
                     {
                         pos++;
                     }
-#if XML10_FIFTH_EDITION
-                    else if (pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], tmpch2)) {
-                        pos += 2;
-                    }
-#endif
                     else
                     {
                         break;
@@ -2570,12 +2532,6 @@ namespace System.Xml
                             pos++;
                             goto ContinueParseName;
                         }
-#if XML10_FIFTH_EDITION
-                        else if ( pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], chars[pos])) {
-                            pos += 2;
-                            goto ContinueParseName;
-                        }
-#endif
 
                         // else fallback to full name parsing routine
 
@@ -5125,12 +5081,6 @@ namespace System.Xml
             {
                 pos++;
             }
-
-#if XML10_FIFTH_EDITION
-            else if ( pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], chars[pos])) {
-                pos += 2;
-            }
-#endif
             else
             {
                 if (pos + 1 >= _ps.charsUsed)
@@ -5158,11 +5108,6 @@ namespace System.Xml
                 {
                     pos++;
                 }
-#if XML10_FIFTH_EDITION
-                else if ( pos + 1 < ps.charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[pos + 1], chars[pos])) {
-                    pos += 2;
-                }
-#endif
                 else
                 {
                     break;
@@ -5190,11 +5135,7 @@ namespace System.Xml
                 }
             }
             // end of buffer
-            else if (pos == _ps.charsUsed
-#if XML10_FIFTH_EDITION
-                || ( pos + 1 == ps.charsUsed && xmlCharType.IsNCNameHighSurrogateChar(chars[pos]))
-#endif
-                )
+            else if (pos == _ps.charsUsed)
             {
                 var tuple_28 = await ReadDataInNameAsync(pos).ConfigureAwait(false);
                 pos = tuple_28.Item1;
index a402f4a..1487069 100644 (file)
@@ -2141,12 +2141,6 @@ namespace System.Xml
             {
                 i = 1;
             }
-#if XML10_FIFTH_EDITION
-            else if (_xmlCharType.IsNCNameSurrogateChar(ncname, 0))
-            { // surrogate ranges are same for NCName and StartNCName
-                i = 2;
-            }
-#endif
             else
             {
                 throw InvalidCharsException(ncname, 0);
@@ -2159,12 +2153,6 @@ namespace System.Xml
                 {
                     i++;
                 }
-#if XML10_FIFTH_EDITION
-                else if (xmlCharType.IsNCNameSurrogateChar(ncname, i))
-                {
-                    i += 2;
-                }
-#endif
                 else
                 {
                     throw InvalidCharsException(ncname, i);
index 3cec114..f0ff98e 100644 (file)
@@ -53,10 +53,6 @@ namespace System.Xml
         // Text settings
         private Encoding _encoding;
 
-#if FEATURE_LEGACYNETCF
-        private bool dontWriteEncodingTag;
-#endif
-
         private bool _omitXmlDecl;
         private NewLineHandling _newLineHandling;
         private string _newLineChars;
@@ -124,21 +120,6 @@ namespace System.Xml
             }
         }
 
-#if FEATURE_LEGACYNETCF
-        internal bool DontWriteEncodingTag
-        {
-            get
-            {
-                return dontWriteEncodingTag;
-            }
-            set
-            {
-                CheckReadOnly(nameof(DontWriteEncodingTag));
-                dontWriteEncodingTag = value;
-            }
-        }
-#endif
-
         // True if an xml declaration should *not* be written.
         public bool OmitXmlDeclaration
         {
index 548d398..f83c30d 100644 (file)
@@ -2824,11 +2824,7 @@ namespace System.Xml
                         }
                         if (_chars[_curPos + 1] != 'C' || _chars[_curPos + 2] != 'L' ||
                              _chars[_curPos + 3] != 'U' || _chars[_curPos + 4] != 'D' ||
-                             _chars[_curPos + 5] != 'E' || _xmlCharType.IsNameSingleChar(_chars[_curPos + 6])
-#if XML10_FIFTH_EDITION
-                             || xmlCharType.IsNCNameHighSurrogateChar( chars[curPos+6] )
-#endif
-                            )
+                             _chars[_curPos + 5] != 'E' || _xmlCharType.IsNameSingleChar(_chars[_curPos + 6]))
                         {
                             goto default;
                         }
@@ -2839,11 +2835,7 @@ namespace System.Xml
                     case 'G':
                         if (_chars[_curPos + 1] != 'N' || _chars[_curPos + 2] != 'O' ||
                              _chars[_curPos + 3] != 'R' || _chars[_curPos + 4] != 'E' ||
-                             _xmlCharType.IsNameSingleChar(_chars[_curPos + 5])
-#if XML10_FIFTH_EDITION
-                            ||xmlCharType.IsNCNameHighSurrogateChar( chars[curPos+5] )
-#endif
-                            )
+                             _xmlCharType.IsNameSingleChar(_chars[_curPos + 5]))
                         {
                             goto default;
                         }
@@ -3012,11 +3004,6 @@ namespace System.Xml
                 {
                     _curPos++;
                 }
-#if XML10_FIFTH_EDITION
-                else if ( curPos + 1 < charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[curPos+1], chars[curPos])) {
-                    curPos += 2;
-                }
-#endif
                 else
                 {
                     if (_curPos + 1 >= _charsUsed)
@@ -3041,11 +3028,6 @@ namespace System.Xml
                     {
                         _curPos++;
                     }
-#if XML10_FIFTH_EDITION
-                    else if ( curPos + 1 < charsUsed && xmlCharType.IsNameSurrogateChar(chars[curPos + 1], chars[curPos]) ) {
-                        curPos += 2;
-                    }
-#endif
                     else
                     {
                         break;
@@ -3071,11 +3053,7 @@ namespace System.Xml
                     }
                 }
                 // end of buffer
-                else if (_curPos == _charsUsed
-#if XML10_FIFTH_EDITION
-                    || ( curPos + 1 == charsUsed && xmlCharType.IsNCNameHighSurrogateChar( chars[curPos] ) )
-#endif
-                    )
+                else if (_curPos == _charsUsed)
                 {
                     if (ReadDataInName())
                     {
@@ -3114,22 +3092,13 @@ namespace System.Xml
                     {
                         _curPos++;
                     }
-#if XML10_FIFTH_EDITION
-                    else if (curPos + 1 < charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[curPos + 1], chars[curPos])) {
-                        curPos += 2;
-                    }
-#endif
                     else
                     {
                         break;
                     }
                 }
 
-                if (_curPos < _charsUsed
-#if XML10_FIFTH_EDITION
-                    && ( !xmlCharType.IsNCNameHighSurrogateChar( chars[curPos] ) || curPos + 1 < charsUsed )
-#endif
-                    )
+                if (_curPos < _charsUsed)
                 {
                     if (_curPos - _tokenStartPos == 0)
                     {
@@ -3562,11 +3531,7 @@ namespace System.Xml
 
         private string ParseUnexpectedToken(int startPos)
         {
-            if (_xmlCharType.IsNCNameSingleChar(_chars[startPos])
-#if XML10_FIFTH_EDITION
-                || xmlCharType.IsNCNameHighSurrogateChar( chars[startPos] )
-#endif
-                )
+            if (_xmlCharType.IsNCNameSingleChar(_chars[startPos]))
             { // postpone the proper surrogate checking to the loop below
                 int endPos = startPos;
                 while (true)
@@ -3575,12 +3540,6 @@ namespace System.Xml
                     {
                         endPos++;
                     }
-#if XML10_FIFTH_EDITION
-                    else if ( chars[endPos] != 0 && // check for end of the buffer
-                              xmlCharType.IsNCNameSurrogateChar( chars[endPos], chars[endPos + 1] ) ) {
-                        endPos += 2;
-                    }
-#endif
                     else
                     {
                         break;
index 732d14e..266df4e 100644 (file)
@@ -2243,11 +2243,7 @@ namespace System.Xml
                         }
                         if (_chars[_curPos + 1] != 'C' || _chars[_curPos + 2] != 'L' ||
                              _chars[_curPos + 3] != 'U' || _chars[_curPos + 4] != 'D' ||
-                             _chars[_curPos + 5] != 'E' || _xmlCharType.IsNameSingleChar(_chars[_curPos + 6])
-#if XML10_FIFTH_EDITION
-                             || xmlCharType.IsNCNameHighSurrogateChar( chars[curPos+6] )
-#endif
-                            )
+                             _chars[_curPos + 5] != 'E' || _xmlCharType.IsNameSingleChar(_chars[_curPos + 6]))
                         {
                             goto default;
                         }
@@ -2258,11 +2254,7 @@ namespace System.Xml
                     case 'G':
                         if (_chars[_curPos + 1] != 'N' || _chars[_curPos + 2] != 'O' ||
                              _chars[_curPos + 3] != 'R' || _chars[_curPos + 4] != 'E' ||
-                             _xmlCharType.IsNameSingleChar(_chars[_curPos + 5])
-#if XML10_FIFTH_EDITION
-                            ||xmlCharType.IsNCNameHighSurrogateChar( chars[curPos+5] )
-#endif
-                            )
+                             _xmlCharType.IsNameSingleChar(_chars[_curPos + 5]))
                         {
                             goto default;
                         }
@@ -2420,11 +2412,6 @@ namespace System.Xml
                 {
                     _curPos++;
                 }
-#if XML10_FIFTH_EDITION
-                else if ( curPos + 1 < charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[curPos+1], chars[curPos])) {
-                    curPos += 2;
-                }
-#endif
                 else
                 {
                     if (_curPos + 1 >= _charsUsed)
@@ -2448,11 +2435,6 @@ namespace System.Xml
                     {
                         _curPos++;
                     }
-#if XML10_FIFTH_EDITION
-                    else if ( curPos + 1 < charsUsed && xmlCharType.IsNameSurrogateChar(chars[curPos + 1], chars[curPos]) ) {
-                        curPos += 2;
-                    }
-#endif
                     else
                     {
                         break;
@@ -2478,11 +2460,7 @@ namespace System.Xml
                     }
                 }
                 // end of buffer
-                else if (_curPos == _charsUsed
-#if XML10_FIFTH_EDITION
-                    || ( curPos + 1 == charsUsed && xmlCharType.IsNCNameHighSurrogateChar( chars[curPos] ) )
-#endif
-                    )
+                else if (_curPos == _charsUsed)
                 {
                     if (await ReadDataInNameAsync().ConfigureAwait(false))
                     {
@@ -2521,22 +2499,13 @@ namespace System.Xml
                     {
                         _curPos++;
                     }
-#if XML10_FIFTH_EDITION
-                    else if (curPos + 1 < charsUsed && xmlCharType.IsNCNameSurrogateChar(chars[curPos + 1], chars[curPos])) {
-                        curPos += 2;
-                    }
-#endif
                     else
                     {
                         break;
                     }
                 }
 
-                if (_curPos < _charsUsed
-#if XML10_FIFTH_EDITION
-                    && ( !xmlCharType.IsNCNameHighSurrogateChar( chars[curPos] ) || curPos + 1 < charsUsed )
-#endif
-                    )
+                if (_curPos < _charsUsed)
                 {
                     if (_curPos - _tokenStartPos == 0)
                     {
index 2217a46..d95186a 100644 (file)
@@ -48,11 +48,6 @@ namespace System.Xml
                 {
                     i++;
                 }
-#if XML10_FIFTH_EDITION
-                else if (xmlCharType.IsNCNameSurrogateChar(s, i)) {
-                    i += 2;
-                }
-#endif
                 else
                 {
                     break;
@@ -84,12 +79,6 @@ namespace System.Xml
                 {
                     i++;
                 }
-#if XML10_FIFTH_EDITION
-                else if (xmlCharType.IsNCNameSurrogateChar(s, i))
-                {
-                    i += 2;
-                }
-#endif
                 else
                 {
                     break;
@@ -128,12 +117,6 @@ namespace System.Xml
                 {
                     i++;
                 }
-#if XML10_FIFTH_EDITION
-                else if (xmlCharType.IsNCNameSurrogateChar(s, i))
-                {
-                    i += 2;
-                }
-#endif
                 else
                 {
                     return 0; // no valid StartNCName char
@@ -146,12 +129,6 @@ namespace System.Xml
                     {
                         i++;
                     }
-#if XML10_FIFTH_EDITION
-                    else if (xmlCharType.IsNCNameSurrogateChar(s, i))
-                    {
-                        i += 2;
-                    }
-#endif
                     else
                     {
                         break;
@@ -190,11 +167,6 @@ namespace System.Xml
                 {
                     i++;
                 }
-#if XML10_FIFTH_EDITION
-                else if (s_xmlCharType.IsNCNameSurrogateChar(s, i)) {
-                    i += 2;
-                }
-#endif
                 else
                 {
                     return 0; // no valid StartNCName char
@@ -207,11 +179,6 @@ namespace System.Xml
                     {
                         i++;
                     }
-#if XML10_FIFTH_EDITION
-                    else if (s_xmlCharType.IsNCNameSurrogateChar(s, i)) {
-                        i += 2;
-                    }
-#endif
                     else
                     {
                         break;
index f2636b5..831d7c8 100644 (file)
@@ -52,22 +52,6 @@ namespace MS.Internal.Xml.XPath
             }
         }
 
-#if XML10_FIFTH_EDITION
-        private char PeekNextChar()
-        {
-            Debug.Assert(0 <= xpathExprIndex && xpathExprIndex <= xpathExpr.Length);
-            if (xpathExprIndex < xpathExpr.Length)
-            {
-                return xpathExpr[xpathExprIndex];
-            }
-            else
-            {
-                Debug.Assert(xpathExprIndex == xpathExpr.Length);
-                return '\0';
-            }
-        }
-#endif
-
         public LexKind Kind { get { return _kind; } }
 
         public string Name
@@ -211,11 +195,7 @@ namespace MS.Internal.Xml.XPath
                         _kind = LexKind.Number;
                         _numberValue = ScanNumber();
                     }
-                    else if (_xmlCharType.IsStartNCNameSingleChar(this.CurrentChar)
-#if XML10_FIFTH_EDITION
-                    || xmlCharType.IsNCNameHighSurrogateChar(this.CurerntChar)
-#endif
-                    )
+                    else if (_xmlCharType.IsStartNCNameSingleChar(this.CurrentChar))
                     {
                         _kind = LexKind.Name;
                         _name = ScanName();
@@ -239,11 +219,7 @@ namespace MS.Internal.Xml.XPath
                                     NextChar();
                                     _name = "*";
                                 }
-                                else if (_xmlCharType.IsStartNCNameSingleChar(this.CurrentChar)
-#if XML10_FIFTH_EDITION
-                                || xmlCharType.IsNCNameHighSurrogateChar(this.CurerntChar)
-#endif
-                                )
+                                else if (_xmlCharType.IsStartNCNameSingleChar(this.CurrentChar))
                                 {
                                     _name = ScanName();
                                 }
@@ -337,11 +313,7 @@ namespace MS.Internal.Xml.XPath
 
         private string ScanName()
         {
-            Debug.Assert(_xmlCharType.IsStartNCNameSingleChar(this.CurrentChar)
-#if XML10_FIFTH_EDITION
-                || xmlCharType.IsNCNameHighSurrogateChar(this.CurerntChar)
-#endif
-                );
+            Debug.Assert(_xmlCharType.IsStartNCNameSingleChar(this.CurrentChar));
             int start = _xpathExprIndex - 1;
             int len = 0;
 
@@ -352,14 +324,6 @@ namespace MS.Internal.Xml.XPath
                     NextChar();
                     len++;
                 }
-#if XML10_FIFTH_EDITION
-                else if (xmlCharType.IsNCNameSurrogateChar(this.PeekNextChar(), this.CurerntChar))
-                {
-                    NextChar();
-                    NextChar();
-                    len += 2;
-                }
-#endif
                 else
                 {
                     break;
index ce85341..62f07e5 100644 (file)
@@ -614,13 +614,6 @@ namespace System.Xml
             return s_xmlCharType.IsStartNCNameSingleChar(ch);
         }
 
-#if XML10_FIFTH_EDITION
-        public static bool IsStartNCNameSurrogatePair(char lowChar, char highChar)
-        {
-            return xmlCharType.IsNCNameSurrogateChar(lowChar, highChar);
-        }
-#endif
-
         // Name character types - as defined in Namespaces XML 1.0 spec (second edition) production [6] NCNameStartChar
         //                        combined with the production [4] NameChar of XML 1.0 spec
         public static bool IsNCNameChar(char ch)
@@ -628,13 +621,6 @@ namespace System.Xml
             return s_xmlCharType.IsNCNameSingleChar(ch);
         }
 
-#if XML10_FIFTH_EDITION
-        public static bool IsNCNameSurrogatePair(char lowChar, char highChar)
-        {
-            return xmlCharType.IsNCNameSurrogateChar(lowChar, highChar);
-        }
-#endif
-
         // Valid XML character - as defined in XML 1.0 spec (fifth edition) production [2] Char
         public static bool IsXmlChar(char ch)
         {
index f746e60..0221f1d 100644 (file)
@@ -112,18 +112,6 @@ namespace System.Xml.Xsl.XPath
             }
         }
 
-#if XML10_FIFTH_EDITION
-        private char PeekNextChar() {
-            Debug.Assert(-1 <= curIndex && curIndex <= xpathExpr.Length);
-            if (curIndex + 1 < xpathExpr.Length) {
-                return xpathExpr[curIndex + 1];
-            }
-            else {
-                return '\0';
-            }
-        }
-#endif
-
         public string Name
         {
             get
@@ -346,11 +334,7 @@ namespace System.Xml.Xsl.XPath
                     ScanNumber();
                     break;
                 default:
-                    if (_xmlCharType.IsStartNCNameSingleChar(_curChar)
-#if XML10_FIFTH_EDITION
-                        || xmlCharType.IsNCNameHighSurrogateChar(curChar)
-#endif
-                        )
+                    if (_xmlCharType.IsStartNCNameSingleChar(_curChar))
                     {
                         _kind = LexKind.Name;
                         _name = ScanNCName();
@@ -380,11 +364,7 @@ namespace System.Xml.Xsl.XPath
                                     _prefix = _name;
                                     _name = "*";
                                 }
-                                else if (_xmlCharType.IsStartNCNameSingleChar(_curChar)
-#if XML10_FIFTH_EDITION
-                                    || xmlCharType.IsNCNameHighSurrogateChar(curChar)
-#endif
-                                    )
+                                else if (_xmlCharType.IsStartNCNameSingleChar(_curChar))
                                 {
                                     _prefix = _name;
                                     _name = ScanNCName();
@@ -547,11 +527,7 @@ namespace System.Xml.Xsl.XPath
 
         private string ScanNCName()
         {
-            Debug.Assert(_xmlCharType.IsStartNCNameSingleChar(_curChar)
-#if XML10_FIFTH_EDITION
-                || xmlCharType.IsNCNameHighSurrogateChar(curChar)
-#endif
-                );
+            Debug.Assert(_xmlCharType.IsStartNCNameSingleChar(_curChar));
             int start = _curIndex;
             while (true)
             {
@@ -559,12 +535,6 @@ namespace System.Xml.Xsl.XPath
                 {
                     NextChar();
                 }
-#if XML10_FIFTH_EDITION
-                else if (xmlCharType.IsNCNameSurrogateChar(PeekNextChar(), curChar)) {
-                    NextChar();
-                    NextChar();
-                }
-#endif
                 else
                 {
                     break;
index 94c7203..0363727 100644 (file)
@@ -2,7 +2,7 @@
   <PropertyGroup>
     <RootNamespace>System.Threading.Tasks.Parallel</RootNamespace>
     <AssemblyName>System.Threading.Tasks.Parallel</AssemblyName>
-    <DefineConstants>$(DefineConstants);CONCURRENT_COLLECTIONS;FEATURE_TRACING</DefineConstants>
+    <DefineConstants>$(DefineConstants);FEATURE_TRACING</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
     <Nullable>enable</Nullable>