Optimize FileReadStream seeking if new position is within the cached buffer

This commit is contained in:
Wojtek Figat
2024-05-13 22:40:27 +02:00
parent 3593f835cd
commit a742ce1d32
2 changed files with 41 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ private:
File* _file;
uint32 _virtualPosInBuffer; // Current position in the buffer (index)
uint32 _bufferSize; // Amount of loaded bytes from the file to the buffer
uint32 _filePosition; // Cached position in the file (native)
byte _buffer[FILESTREAM_BUFFER_SIZE];
public: