Fix IDE00007
This commit is contained in:
committed by
Gustas Kažukauskas
parent
0ed00a5766
commit
3745377387
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user