mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 09:21:57 +08:00
Use of Memory<> instead of direct Span to avoid byte array allocation .ToArray.
Suggestion from (4153e4a1b4 (r1619509165))
This commit is contained in:
parent
4153e4a1b4
commit
ea82bf8aa5
@ -446,14 +446,14 @@
|
||||
dataLength -= 2;
|
||||
}
|
||||
|
||||
Span<byte> data = new byte[dataLength];
|
||||
Memory<byte> data = new byte[dataLength];
|
||||
|
||||
inputBytes.Seek(streamDataStart);
|
||||
inputBytes.Read(data);
|
||||
inputBytes.Read(data.Span);
|
||||
|
||||
inputBytes.Seek(streamDataEnd);
|
||||
|
||||
stream = new StreamToken(streamDictionaryToken, data.ToArray());
|
||||
stream = new StreamToken(streamDictionaryToken, data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user