1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Optimised the base class implementation of InputStream::skipNextBytes() a bit

This commit is contained in:
ed 2018-08-15 15:35:55 +01:00
parent abbe9d1adf
commit 6ca7af73cf

View file

@ -218,6 +218,10 @@ void InputStream::skipNextBytes (int64 numBytesToSkip)
{
if (numBytesToSkip > 0)
{
// try to just set the position first as this will be much faster than reading each byte
if (setPosition (getPosition() + numBytesToSkip))
return;
auto skipBufferSize = (int) jmin (numBytesToSkip, (int64) 16384);
HeapBlock<char> temp (skipBufferSize);