Browse Source

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

tags/2021-05-28
ed 7 years ago
parent
commit
6ca7af73cf
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      modules/juce_core/streams/juce_InputStream.cpp

+ 4
- 0
modules/juce_core/streams/juce_InputStream.cpp 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);


Loading…
Cancel
Save