Update uses of AsBytes to use MemoryMarshal.AsBytes (dotnet/corefx#28460)
authorAhson Khan <ahkha@microsoft.com>
Mon, 26 Mar 2018 05:19:11 +0000 (22:19 -0700)
committerJan Kotas <jkotas@microsoft.com>
Mon, 26 Mar 2018 18:11:45 +0000 (11:11 -0700)
* Update uses of AsBytes to use MemoryMarshal.AsBytes

* Cleanup commented out code

* Remove AsBytes from MemoryExtensions Portable

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
src/mscorlib/shared/System/Globalization/CompareInfo.cs

index 71dc270..4ccd739 100644 (file)
@@ -1249,7 +1249,7 @@ namespace System.Globalization
             int charsWritten = source.AsSpan().ToUpperInvariant(span);
 
             // Slice the array to the size returned by ToUpperInvariant.
-            int hash = Marvin.ComputeHash32(span.Slice(0, charsWritten).AsBytes(), Marvin.DefaultSeed);
+            int hash = Marvin.ComputeHash32(MemoryMarshal.AsBytes(span.Slice(0, charsWritten)), Marvin.DefaultSeed);
 
             // Return the borrowed array if necessary.
             if (borrowedArr != null)