Fix IDE00007

This commit is contained in:
RoosterDragon
2025-11-11 18:07:47 +00:00
committed by Gustas Kažukauskas
parent 0ed00a5766
commit 3745377387

View File

@@ -149,7 +149,7 @@ namespace OpenRA
public static string ReadASCII(this Stream s, int length)
{
Span<byte> buffer = length < 128 ? stackalloc byte[length] : new byte[length];
var buffer = length < 128 ? stackalloc byte[length] : new byte[length];
s.ReadBytes(buffer);
return Encoding.ASCII.GetString(buffer);
}
@@ -263,7 +263,7 @@ namespace OpenRA
if (length > maxLength)
throw new InvalidOperationException($"The length of the string ({length}) is longer than the maximum allowed ({maxLength}).");
Span<byte> buffer = length < 128 ? stackalloc byte[length] : new byte[length];
var buffer = length < 128 ? stackalloc byte[length] : new byte[length];
s.ReadBytes(buffer);
return encoding.GetString(buffer);
}