Skip to content

Commit d17df09

Browse files
committed
Remove redundant .AsSpan()
1 parent 178b35c commit d17df09

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/BizHawk.Common/Extensions/CollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public static T[] ConcatArrays<T>(/*params*/ IReadOnlyCollection<T[]> arrays)
291291
var i = 0;
292292
foreach (var arr in arrays)
293293
{
294-
arr.AsSpan().CopyTo(combined.AsSpan(start: i));
294+
arr.CopyTo(combined.AsSpan(start: i));
295295
i += arr.Length;
296296
}
297297
return combined;

src/BizHawk.Emulation.Common/N3DSHasher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ private void GetNCCHNormalKeys(ReadOnlySpan<byte> primaryKeyYRaw, byte secondary
123123
Array.Reverse(primaryKeyYBytes); // convert big endian to little endian
124124
var primaryKeyY = new BigInteger(primaryKeyYBytes);
125125

126-
Derive3DSNormalKey(primaryKeyX, primaryKeyY).AsSpan().CopyTo(primaryKey);
126+
Derive3DSNormalKey(primaryKeyX, primaryKeyY).CopyTo(primaryKey);
127127

128128
if (programIdBytes.IsEmpty)
129129
{
130-
Derive3DSNormalKey(secondaryKeyX, primaryKeyY).AsSpan().CopyTo(secondaryKey);
130+
Derive3DSNormalKey(secondaryKeyX, primaryKeyY).CopyTo(secondaryKey);
131131
return;
132132
}
133133

@@ -162,7 +162,7 @@ private void GetNCCHNormalKeys(ReadOnlySpan<byte> primaryKeyYRaw, byte secondary
162162
Buffer.BlockCopy(sha256Digest, 0, secondaryKeyYBytes, 1, 16);
163163
Array.Reverse(secondaryKeyYBytes); // convert big endian to little endian
164164
var secondaryKeyY = new BigInteger(secondaryKeyYBytes);
165-
Derive3DSNormalKey(secondaryKeyX, secondaryKeyY).AsSpan().CopyTo(secondaryKey);
165+
Derive3DSNormalKey(secondaryKeyX, secondaryKeyY).CopyTo(secondaryKey);
166166
return;
167167
}
168168

src/BizHawk.Emulation.Cores/Computers/Commodore64/Media/DiskTrack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public sealed class DiskTrack
5555
public DiskTrack Clone()
5656
{
5757
var clone = new DiskTrack();
58-
Bits.CopyTo(clone._bits.AsSpan());
58+
Bits.CopyTo(clone._bits);
5959
clone._original = _original;
6060
return clone;
6161
}

src/BizHawk.Emulation.DiscSystem/DiscHasher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public string OldHash()
197197

198198
if (byteswapped)
199199
{
200-
EndiannessUtils.MutatingByteSwap16(buf2352.AsSpan());
200+
EndiannessUtils.MutatingByteSwap16(buf2352);
201201
}
202202

203203
buffer.AddRange(new ArraySegment<byte>(buf2352, bootOff, Math.Min(2352 - bootOff, bootLen)));
@@ -209,7 +209,7 @@ public string OldHash()
209209

210210
if (byteswapped)
211211
{
212-
EndiannessUtils.MutatingByteSwap16(buf2352.AsSpan());
212+
EndiannessUtils.MutatingByteSwap16(buf2352);
213213
}
214214

215215
buffer.AddRange(new ArraySegment<byte>(buf2352, 0, Math.Min(2352, bootLen)));

0 commit comments

Comments
 (0)