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:
parent
abbe9d1adf
commit
6ca7af73cf
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue