AsReadOnlySpan -> AsSpan rename to fix build breaks
authorJan Kotas <jkotas@microsoft.com>
Fri, 23 Feb 2018 02:49:03 +0000 (18:49 -0800)
committerJan Kotas <jkotas@microsoft.com>
Fri, 23 Feb 2018 03:56:34 +0000 (19:56 -0800)
18 files changed:
src/mscorlib/shared/System/Boolean.cs
src/mscorlib/shared/System/Collections/Generic/ValueListBuilder.cs
src/mscorlib/shared/System/Convert.cs
src/mscorlib/shared/System/Globalization/CompareInfo.cs
src/mscorlib/shared/System/Globalization/DateTimeParse.cs
src/mscorlib/shared/System/Globalization/HijriCalendar.Win32.cs
src/mscorlib/shared/System/Globalization/JapaneseCalendar.Win32.cs
src/mscorlib/shared/System/IO/Path.Unix.cs
src/mscorlib/shared/System/IO/Path.Windows.cs
src/mscorlib/shared/System/IO/Path.cs
src/mscorlib/shared/System/IO/StreamWriter.cs
src/mscorlib/shared/System/Number.Formatting.cs
src/mscorlib/shared/System/Span.NonGeneric.cs
src/mscorlib/shared/System/String.Manipulation.cs
src/mscorlib/shared/System/StringSpanHelpers.cs
src/mscorlib/shared/System/Text/StringBuilder.cs
src/mscorlib/shared/System/TimeZoneInfo.Unix.cs
src/mscorlib/shared/System/Version.cs

index c1f4bc9..fd56082 100644 (file)
@@ -100,7 +100,7 @@ namespace System
         {
             string s = m_value ? TrueLiteral : FalseLiteral;
 
-            if (s.AsReadOnlySpan().TryCopyTo(destination))
+            if (s.AsSpan().TryCopyTo(destination))
             {
                 charsWritten = s.Length;
                 return true;
@@ -181,7 +181,7 @@ namespace System
         public static Boolean Parse(String value)
         {
             if (value == null) throw new ArgumentNullException(nameof(value));
-            return Parse(value.AsReadOnlySpan());
+            return Parse(value.AsSpan());
         }
 
         public static bool Parse(ReadOnlySpan<char> value) =>
@@ -197,19 +197,19 @@ namespace System
                 return false;
             }
 
-            return TryParse(value.AsReadOnlySpan(), out result);
+            return TryParse(value.AsSpan(), out result);
         }
 
         public static bool TryParse(ReadOnlySpan<char> value, out bool result)
         {
-            ReadOnlySpan<char> trueSpan = TrueLiteral.AsReadOnlySpan();
+            ReadOnlySpan<char> trueSpan = TrueLiteral.AsSpan();
             if (StringSpanHelpers.Equals(trueSpan, value, StringComparison.OrdinalIgnoreCase))
             {
                 result = true;
                 return true;
             }
 
-            ReadOnlySpan<char> falseSpan = FalseLiteral.AsReadOnlySpan();
+            ReadOnlySpan<char> falseSpan = FalseLiteral.AsSpan();
             if (StringSpanHelpers.Equals(falseSpan, value, StringComparison.OrdinalIgnoreCase))
             {
                 result = false;
index 26b3c9f..72da4a9 100644 (file)
@@ -43,7 +43,7 @@ namespace System.Collections.Generic
             _pos = pos + 1;
         }
 
-        public ReadOnlySpan<T> AsReadOnlySpan()
+        public ReadOnlySpan<T> AsSpan()
         {
             return _span.Slice(0, _pos);
         }
index 488ea77..756bf17 100644 (file)
@@ -2198,7 +2198,7 @@ namespace System
                 return 0;
             }
 
-            int r = ParseNumbers.StringToInt(value.AsReadOnlySpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsUnsigned);
+            int r = ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsUnsigned);
             if (r < Byte.MinValue || r > Byte.MaxValue)
                 ThrowByteOverflowException();
             return (byte)r;
@@ -2221,7 +2221,7 @@ namespace System
                 return 0;
             }
 
-            int r = ParseNumbers.StringToInt(value.AsReadOnlySpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsI1);
+            int r = ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsI1);
             if (fromBase != 10 && r <= Byte.MaxValue)
                 return (sbyte)r;
 
@@ -2246,7 +2246,7 @@ namespace System
                 return 0;
             }
 
-            int r = ParseNumbers.StringToInt(value.AsReadOnlySpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsI2);
+            int r = ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsI2);
             if (fromBase != 10 && r <= UInt16.MaxValue)
                 return (short)r;
 
@@ -2272,7 +2272,7 @@ namespace System
                 return 0;
             }
 
-            int r = ParseNumbers.StringToInt(value.AsReadOnlySpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsUnsigned);
+            int r = ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsUnsigned);
             if (r < UInt16.MinValue || r > UInt16.MaxValue)
                 ThrowUInt16OverflowException();
             return (ushort)r;
@@ -2289,7 +2289,7 @@ namespace System
                 throw new ArgumentException(SR.Arg_InvalidBase);
             }
             return value != null ?
-                ParseNumbers.StringToInt(value.AsReadOnlySpan(), fromBase, ParseNumbers.IsTight) :
+                ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight) :
                 0;
         }
 
@@ -2305,7 +2305,7 @@ namespace System
                 throw new ArgumentException(SR.Arg_InvalidBase);
             }
             return value != null ?
-                (uint)ParseNumbers.StringToInt(value.AsReadOnlySpan(), fromBase, ParseNumbers.TreatAsUnsigned | ParseNumbers.IsTight) :
+                (uint)ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.TreatAsUnsigned | ParseNumbers.IsTight) :
                 0;
         }
 
@@ -2320,7 +2320,7 @@ namespace System
                 throw new ArgumentException(SR.Arg_InvalidBase);
             }
             return value != null ?
-                ParseNumbers.StringToLong(value.AsReadOnlySpan(), fromBase, ParseNumbers.IsTight) :
+                ParseNumbers.StringToLong(value.AsSpan(), fromBase, ParseNumbers.IsTight) :
                 0;
         }
 
@@ -2336,7 +2336,7 @@ namespace System
                 throw new ArgumentException(SR.Arg_InvalidBase);
             }
             return value != null ?
-                (ulong)ParseNumbers.StringToLong(value.AsReadOnlySpan(), fromBase, ParseNumbers.TreatAsUnsigned | ParseNumbers.IsTight) :
+                (ulong)ParseNumbers.StringToLong(value.AsSpan(), fromBase, ParseNumbers.TreatAsUnsigned | ParseNumbers.IsTight) :
                 0;
         }
 
@@ -2653,7 +2653,7 @@ namespace System
                 throw new ArgumentNullException(nameof(s));
             }
 
-            return TryFromBase64Chars(s.AsReadOnlySpan(), bytes, out bytesWritten);
+            return TryFromBase64Chars(s.AsSpan(), bytes, out bytesWritten);
         }
 
         public static unsafe bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten)
index 8020fad..8dbfed1 100644 (file)
@@ -344,7 +344,7 @@ namespace System.Globalization
                 return String.CompareOrdinal(string1, string2);
             }
 
-            return CompareString(string1.AsReadOnlySpan(), string2.AsReadOnlySpan(), options);
+            return CompareString(string1.AsSpan(), string2.AsSpan(), options);
         }
 
         // TODO https://github.com/dotnet/coreclr/issues/13827:
@@ -354,7 +354,7 @@ namespace System.Globalization
         {
             if (options == CompareOptions.OrdinalIgnoreCase)
             {
-                return CompareOrdinalIgnoreCase(string1, string2.AsReadOnlySpan());
+                return CompareOrdinalIgnoreCase(string1, string2.AsSpan());
             }
 
             // Verify the options before we do any real comparison.
@@ -365,7 +365,7 @@ namespace System.Globalization
                     throw new ArgumentException(SR.Argument_CompareOptionOrdinal, nameof(options));
                 }
 
-                return string.CompareOrdinal(string1, string2.AsReadOnlySpan());
+                return string.CompareOrdinal(string1, string2.AsSpan());
             }
 
             if ((options & ValidCompareMaskOffFlags) != 0)
@@ -382,8 +382,8 @@ namespace System.Globalization
             if (_invariantMode)
             {
                 return (options & CompareOptions.IgnoreCase) != 0 ?
-                    CompareOrdinalIgnoreCase(string1, string2.AsReadOnlySpan()) :
-                    string.CompareOrdinal(string1, string2.AsReadOnlySpan());
+                    CompareOrdinalIgnoreCase(string1, string2.AsSpan()) :
+                    string.CompareOrdinal(string1, string2.AsSpan());
             }
 
             return CompareString(string1, string2, options);
@@ -526,8 +526,8 @@ namespace System.Globalization
             }
 
             return CompareString(
-                string1.AsReadOnlySpan().Slice(offset1, length1),
-                string2.AsReadOnlySpan().Slice(offset2, length2),
+                string1.AsSpan().Slice(offset1, length1),
+                string2.AsSpan().Slice(offset2, length2),
                 options);
         }
 
@@ -551,7 +551,7 @@ namespace System.Globalization
         {
             Debug.Assert(indexA + lengthA <= strA.Length);
             Debug.Assert(indexB + lengthB <= strB.Length);
-            return CompareOrdinalIgnoreCase(strA.AsReadOnlySpan().Slice(indexA, lengthA), strB.AsReadOnlySpan().Slice(indexB, lengthB));
+            return CompareOrdinalIgnoreCase(strA.AsSpan().Slice(indexA, lengthA), strB.AsSpan().Slice(indexB, lengthB));
         }
 
         internal static unsafe int CompareOrdinalIgnoreCase(ReadOnlySpan<char> strA, ReadOnlySpan<char> strB)
index 049aae3..5b285eb 100644 (file)
@@ -5045,7 +5045,7 @@ new DS[] { DS.ERROR, DS.TX_NNN,  DS.TX_NNN,  DS.TX_NNN,  DS.ERROR,   DS.ERROR,
                         {
                             return false;
                         }
-                        if (m_info.Compare(Value.Slice(thisPosition, segmentLength), target.AsReadOnlySpan().Slice(targetPosition, segmentLength), CompareOptions.IgnoreCase) != 0)
+                        if (m_info.Compare(Value.Slice(thisPosition, segmentLength), target.AsSpan().Slice(targetPosition, segmentLength), CompareOptions.IgnoreCase) != 0)
                         {
                             return false;
                         }
@@ -5071,7 +5071,7 @@ new DS[] { DS.ERROR, DS.TX_NNN,  DS.TX_NNN,  DS.TX_NNN,  DS.ERROR,   DS.ERROR,
                     {
                         return false;
                     }
-                    if (m_info.Compare(Value.Slice(thisPosition, segmentLength), target.AsReadOnlySpan().Slice(targetPosition, segmentLength), CompareOptions.IgnoreCase) != 0)
+                    if (m_info.Compare(Value.Slice(thisPosition, segmentLength), target.AsSpan().Slice(targetPosition, segmentLength), CompareOptions.IgnoreCase) != 0)
                     {
                         return false;
                     }
index 09b1f20..365942c 100644 (file)
@@ -69,7 +69,7 @@ namespace System.Globalization
                         {
                             try
                             {
-                                int advance = Int32.Parse(str.AsReadOnlySpan().Slice(HijriAdvanceRegKeyEntry.Length), provider:CultureInfo.InvariantCulture);
+                                int advance = Int32.Parse(str.AsSpan().Slice(HijriAdvanceRegKeyEntry.Length), provider:CultureInfo.InvariantCulture);
                                 if ((advance >= MinAdvancedHijri) && (advance <= MaxAdvancedHijri))
                                 {
                                     hijriAdvance = advance;
index 9ea6c21..1d0180b 100644 (file)
@@ -159,7 +159,7 @@ namespace System.Globalization
             int month;
             int day;
 
-            ReadOnlySpan<char> valueSpan = value.AsReadOnlySpan();
+            ReadOnlySpan<char> valueSpan = value.AsSpan();
             if (!Int32.TryParse(valueSpan.Slice(0, 4), NumberStyles.None, NumberFormatInfo.InvariantInfo, out year) ||
                 !Int32.TryParse(valueSpan.Slice(5, 2), NumberStyles.None, NumberFormatInfo.InvariantInfo, out month) ||
                 !Int32.TryParse(valueSpan.Slice(8, 2), NumberStyles.None, NumberFormatInfo.InvariantInfo, out day))
index 5d07f72..1294930 100644 (file)
@@ -108,7 +108,7 @@ namespace System.IO
             if (path == null)
                 return false;
 
-            return IsPathRooted(path.AsReadOnlySpan());
+            return IsPathRooted(path.AsSpan());
         }
 
         public static bool IsPathRooted(ReadOnlySpan<char> path)
@@ -128,7 +128,7 @@ namespace System.IO
 
         public static ReadOnlySpan<char> GetPathRoot(ReadOnlySpan<char> path)
         {
-            return PathInternal.IsEffectivelyEmpty(path) && IsPathRooted(path) ? PathInternal.DirectorySeparatorCharAsString.AsReadOnlySpan() : ReadOnlySpan<char>.Empty;
+            return PathInternal.IsEffectivelyEmpty(path) && IsPathRooted(path) ? PathInternal.DirectorySeparatorCharAsString.AsSpan() : ReadOnlySpan<char>.Empty;
         }
 
         /// <summary>Gets whether the system is case-sensitive.</summary>
index 846dd53..6a8745d 100644 (file)
@@ -80,19 +80,19 @@ namespace System.IO
                 // Path is current drive rooted i.e. starts with \:
                 // "\Foo" and "C:\Bar" => "C:\Foo"
                 // "\Foo" and "\\?\C:\Bar" => "\\?\C:\Foo"
-                combinedPath = CombineNoChecks(GetPathRoot(basePath), path.AsReadOnlySpan().Slice(1));
+                combinedPath = CombineNoChecks(GetPathRoot(basePath), path.AsSpan().Slice(1));
             }
             else if (length >= 2 && PathInternal.IsValidDriveChar(path[0]) && path[1] == PathInternal.VolumeSeparatorChar)
             {
                 // Drive relative paths
                 Debug.Assert(length == 2 || !PathInternal.IsDirectorySeparator(path[2]));
 
-                if (StringSpanHelpers.Equals(GetVolumeName(path.AsReadOnlySpan()), GetVolumeName(basePath.AsReadOnlySpan())))
+                if (StringSpanHelpers.Equals(GetVolumeName(path.AsSpan()), GetVolumeName(basePath.AsSpan())))
                 {
                     // Matching root
                     // "C:Foo" and "C:\Bar" => "C:\Bar\Foo"
                     // "C:Foo" and "\\?\C:\Bar" => "\\?\C:\Bar\Foo"
-                    combinedPath = CombineNoChecks(basePath, path.AsReadOnlySpan().Slice(2));
+                    combinedPath = CombineNoChecks(basePath, path.AsSpan().Slice(2));
                 }
                 else
                 {
@@ -144,7 +144,7 @@ namespace System.IO
         // if it starts with a backslash ("\") or a valid drive letter and a colon (":").
         public static bool IsPathRooted(string path)
         {
-            return path != null && IsPathRooted(path.AsReadOnlySpan());
+            return path != null && IsPathRooted(path.AsSpan());
         }
 
         public static bool IsPathRooted(ReadOnlySpan<char> path)
@@ -168,7 +168,7 @@ namespace System.IO
             if (PathInternal.IsEffectivelyEmpty(path))
                 return null;
 
-            ReadOnlySpan<char> result = GetPathRoot(path.AsReadOnlySpan());
+            ReadOnlySpan<char> result = GetPathRoot(path.AsSpan());
             if (path.Length == result.Length)
                 return PathInternal.NormalizeDirectorySeparators(path);
 
index 3784b87..7685099 100644 (file)
@@ -130,7 +130,7 @@ namespace System.IO
             if (path == null)
                 return null;
 
-            return new string(GetExtension(path.AsReadOnlySpan()));
+            return new string(GetExtension(path.AsSpan()));
         }
 
         /// <summary>
@@ -169,7 +169,7 @@ namespace System.IO
             if (path == null)
                 return null;
 
-            ReadOnlySpan<char> result = GetFileName(path.AsReadOnlySpan());
+            ReadOnlySpan<char> result = GetFileName(path.AsSpan());
             if (path.Length == result.Length)
                 return path;
 
@@ -200,7 +200,7 @@ namespace System.IO
             if (path == null)
                 return null;
 
-            ReadOnlySpan<char> result = GetFileNameWithoutExtension(path.AsReadOnlySpan());
+            ReadOnlySpan<char> result = GetFileNameWithoutExtension(path.AsSpan());
             if (path.Length == result.Length)
                 return path;
 
@@ -254,7 +254,7 @@ namespace System.IO
             if (path == null)
                 throw new ArgumentNullException(nameof(path));
 
-            return IsPathFullyQualified(path.AsReadOnlySpan());
+            return IsPathFullyQualified(path.AsSpan());
         }
 
         public static bool IsPathFullyQualified(ReadOnlySpan<char> path)
@@ -271,7 +271,7 @@ namespace System.IO
         {
             if (path != null)
             {
-                return HasExtension(path.AsReadOnlySpan());
+                return HasExtension(path.AsSpan());
             }
             return false;
         }
@@ -411,7 +411,7 @@ namespace System.IO
             if (string.IsNullOrEmpty(second))
                 return first;
 
-            if (IsPathRooted(second.AsReadOnlySpan()))
+            if (IsPathRooted(second.AsSpan()))
                 return second;
 
             return CombineNoChecksInternal(first, second);
@@ -443,9 +443,9 @@ namespace System.IO
             if (string.IsNullOrEmpty(third))
                 return CombineNoChecks(first, second);
 
-            if (IsPathRooted(third.AsReadOnlySpan()))
+            if (IsPathRooted(third.AsSpan()))
                 return third;
-            if (IsPathRooted(second.AsReadOnlySpan()))
+            if (IsPathRooted(second.AsSpan()))
                 return CombineNoChecks(second, third);
 
             return CombineNoChecksInternal(first, second, third);
@@ -483,11 +483,11 @@ namespace System.IO
             if (string.IsNullOrEmpty(fourth))
                 return CombineNoChecks(first, second, third);
 
-            if (IsPathRooted(fourth.AsReadOnlySpan()))
+            if (IsPathRooted(fourth.AsSpan()))
                 return fourth;
-            if (IsPathRooted(third.AsReadOnlySpan()))
+            if (IsPathRooted(third.AsSpan()))
                 return CombineNoChecks(third, fourth);
-            if (IsPathRooted(second.AsReadOnlySpan()))
+            if (IsPathRooted(second.AsSpan()))
                 return CombineNoChecks(second, third, fourth);
 
             return CombineNoChecksInternal(first, second, third, fourth);
index 5826f91..6cdcd69 100644 (file)
@@ -432,7 +432,7 @@ namespace System.IO
         {
             if (value != null)
             {
-                WriteCore(value.AsReadOnlySpan(), _autoFlush);
+                WriteCore(value.AsSpan(), _autoFlush);
             }
         }
 
@@ -445,7 +445,7 @@ namespace System.IO
             CheckAsyncTaskInProgress();
             if (value != null)
             {
-                WriteCore(value.AsReadOnlySpan(), autoFlush: false);
+                WriteCore(value.AsSpan(), autoFlush: false);
             }
             WriteCore(new ReadOnlySpan<char>(CoreNewLine), autoFlush: true);
         }
index 58d501b..24d5db1 100644 (file)
@@ -564,7 +564,7 @@ namespace System
         {
             Debug.Assert(source != null);
 
-            if (source.AsReadOnlySpan().TryCopyTo(destination))
+            if (source.AsSpan().TryCopyTo(destination))
             {
                 charsWritten = source.Length;
                 return true;
index 2331664..ff2d773 100644 (file)
@@ -632,7 +632,7 @@ namespace System
         /// <remarks>Returns default when <paramref name="text"/> is null.</remarks>
         /// reference (Nothing in Visual Basic).</exception>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static ReadOnlySpan<char> AsReadOnlySpan(this string text)
+        public static ReadOnlySpan<char> AsSpan(this string text)
         {
             if (text == null)
                 return default;
@@ -649,7 +649,7 @@ namespace System
         /// Thrown when the specified <paramref name="start"/> index is not in range (&lt;0 or &gt;text.Length).
         /// </exception>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static ReadOnlySpan<char> AsReadOnlySpan(this string text, int start)
+        public static ReadOnlySpan<char> AsSpan(this string text, int start)
         {
             if (text == null)
             {
@@ -673,7 +673,7 @@ namespace System
         /// Thrown when the specified <paramref name="start"/> index or <paramref name="length"/> is not in range.
         /// </exception>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static ReadOnlySpan<char> AsReadOnlySpan(this string text, int start, int length)
+        public static ReadOnlySpan<char> AsSpan(this string text, int start, int length)
         {
             if (text == null)
             {
@@ -688,6 +688,11 @@ namespace System
             return new ReadOnlySpan<char>(ref Unsafe.Add(ref text.GetRawStringData(), start), length);
         }
 
+        // TODO: Delete once the AsReadOnlySpan -> AsSpan rename propages through the system
+        public static ReadOnlySpan<char> AsReadOnlySpan(this string text) => AsSpan(text);
+        public static ReadOnlySpan<char> AsReadOnlySpan(this string text, int start) => AsSpan(text, start);
+        public static ReadOnlySpan<char> AsReadOnlySpan(this string text, int start, int length) => AsSpan(text, start, length);
+
         internal static unsafe void ClearWithoutReferences(ref byte b, nuint byteLength)
         {
             if (byteLength == 0)
index 1d500e8..76cbfaa 100644 (file)
@@ -1107,7 +1107,7 @@ namespace System
 
             // String allocation and copying is in separate method to make this method faster for the case where
             // nothing needs replacing.
-            string dst = ReplaceHelper(oldValue.Length, newValue, replacementIndices.AsReadOnlySpan());
+            string dst = ReplaceHelper(oldValue.Length, newValue, replacementIndices.AsSpan());
 
             replacementIndices.Dispose();
 
@@ -1136,19 +1136,19 @@ namespace System
                 int count = replacementIdx - thisIdx;
                 if (count != 0)
                 {
-                    this.AsReadOnlySpan().Slice(thisIdx, count).CopyTo(dstSpan.Slice(dstIdx));
+                    this.AsSpan().Slice(thisIdx, count).CopyTo(dstSpan.Slice(dstIdx));
                     dstIdx += count;
                 }
                 thisIdx = replacementIdx + oldValueLength;
 
                 // Copy over newValue to replace the oldValue.
-                newValue.AsReadOnlySpan().CopyTo(dstSpan.Slice(dstIdx));
+                newValue.AsSpan().CopyTo(dstSpan.Slice(dstIdx));
                 dstIdx += newValue.Length;
             }
 
             // Copy over the final non-matching portion at the end of the string.
             Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx);
-            this.AsReadOnlySpan().Slice(thisIdx).CopyTo(dstSpan.Slice(dstIdx));
+            this.AsSpan().Slice(thisIdx).CopyTo(dstSpan.Slice(dstIdx));
 
             return dst;
         }
@@ -1228,7 +1228,7 @@ namespace System
             var sepListBuilder = new ValueListBuilder<int>(initialSpan);
 
             MakeSeparatorList(separators, ref sepListBuilder);
-            ReadOnlySpan<int> sepList = sepListBuilder.AsReadOnlySpan();
+            ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
 
             // Handle the special case of no replaces.
             if (sepList.Length == 0)
@@ -1309,8 +1309,8 @@ namespace System
             var lengthListBuilder = new ValueListBuilder<int>(lengthListInitialSpan);
 
             MakeSeparatorList(separators, ref sepListBuilder, ref lengthListBuilder);
-            ReadOnlySpan<int> sepList = sepListBuilder.AsReadOnlySpan();
-            ReadOnlySpan<int> lengthList = lengthListBuilder.AsReadOnlySpan();
+            ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
+            ReadOnlySpan<int> lengthList = lengthListBuilder.AsSpan();
             
             // Handle the special case of no replaces.
             if (sepList.Length == 0)
@@ -1334,7 +1334,7 @@ namespace System
             var sepListBuilder = new ValueListBuilder<int>(sepListInitialSpan);
 
             MakeSeparatorList(separator, ref sepListBuilder);
-            ReadOnlySpan<int> sepList = sepListBuilder.AsReadOnlySpan();
+            ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
             if (sepList.Length == 0)
             {
                 // there are no separators so sepListBuilder did not rent an array from pool and there is no need to dispose it
index 7419adb..58820a8 100644 (file)
@@ -17,7 +17,7 @@ namespace System
             throw new ArgumentOutOfRangeException(nameof(comparisonType));
 
         public static bool Equals(this ReadOnlySpan<char> left, string right) =>
-            Equals(left, right.AsReadOnlySpan());
+            Equals(left, right.AsSpan());
 
         public static bool Equals(this ReadOnlySpan<char> left, ReadOnlySpan<char> right)
         {
index 19c1549..a7804c3 100644 (file)
@@ -1552,7 +1552,7 @@ namespace System.Text
                         if (startPos != pos)
                         {
                             // There was no brace escaping, extract the item format as a single string
-                            itemFormatSpan = format.AsReadOnlySpan().Slice(startPos, pos - startPos);
+                            itemFormatSpan = format.AsSpan().Slice(startPos, pos - startPos);
                         }
                     }
                     else
index a06545f..410eaf3 100644 (file)
@@ -1198,9 +1198,9 @@ namespace System
                     int secondDotIndex = dateRule.IndexOf('.', firstDotIndex + 1);
                     if (secondDotIndex > 0)
                     {
-                        if (int.TryParse(dateRule.AsReadOnlySpan().Slice(1, firstDotIndex - 1), out month) &&
-                            int.TryParse(dateRule.AsReadOnlySpan().Slice(firstDotIndex + 1, secondDotIndex - firstDotIndex - 1), out week) &&
-                            int.TryParse(dateRule.AsReadOnlySpan().Slice(secondDotIndex + 1), out int day))
+                        if (int.TryParse(dateRule.AsSpan().Slice(1, firstDotIndex - 1), out month) &&
+                            int.TryParse(dateRule.AsSpan().Slice(firstDotIndex + 1, secondDotIndex - firstDotIndex - 1), out week) &&
+                            int.TryParse(dateRule.AsSpan().Slice(secondDotIndex + 1), out int day))
                         {
                             dayOfWeek = (DayOfWeek)day;
                             return true;
index df16be2..9e4cefc 100644 (file)
@@ -300,7 +300,7 @@ namespace System
                 throw new ArgumentNullException(nameof(input));
             }
 
-            return ParseVersion(input.AsReadOnlySpan(), throwOnFailure: true);
+            return ParseVersion(input.AsSpan(), throwOnFailure: true);
         }
 
         public static Version Parse(ReadOnlySpan<char> input) =>
@@ -314,7 +314,7 @@ namespace System
                 return false;
             }
 
-            return (result = ParseVersion(input.AsReadOnlySpan(), throwOnFailure: false)) != null;
+            return (result = ParseVersion(input.AsSpan(), throwOnFailure: false)) != null;
         }
 
         public static bool TryParse(ReadOnlySpan<char> input, out Version result) =>