зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1642951
- Don't fill the nsBufferedStream buffer when seeking to 0, to avoid opening lazy inner streams. r=baku,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D91362
This commit is contained in:
Родитель
6a589167f0
Коммит
d54cb42cc5
|
@ -224,6 +224,13 @@ nsBufferedStream::Seek(int32_t whence, int64_t offset) {
|
|||
.mNewOffset = mBufferStartOffset);
|
||||
|
||||
mFillPoint = mCursor = 0;
|
||||
|
||||
// If we seeked back to the start, then don't fill the buffer
|
||||
// right now in case this is a lazily-opened file stream.
|
||||
// We'll fill on the first read, like we did initially.
|
||||
if (whence == nsISeekableStream::NS_SEEK_SET && offset == 0) {
|
||||
return NS_OK;
|
||||
}
|
||||
return Fill();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче