diff --git a/fbreader/fbreader/zlibrary/core/src/filesystem/ZLFile.cpp b/fbreader/fbreader/zlibrary/core/src/filesystem/ZLFile.cpp index b8b4bee..5bef70e 100644 --- a/fbreader/fbreader/zlibrary/core/src/filesystem/ZLFile.cpp +++ b/fbreader/fbreader/zlibrary/core/src/filesystem/ZLFile.cpp @@ -32,7 +32,13 @@ const ZLFile ZLFile::NO_FILE; +#ifndef FBREADER_DISABLE_ZLFILE_PLAIN_STREAM_CACHE +# define FBREADER_DISABLE_ZLFILE_PLAIN_STREAM_CACHE 0 +#endif + +#if !FBREADER_DISABLE_ZLFILE_PLAIN_STREAM_CACHE std::map > ZLFile::ourPlainStreamCache; +#endif ZLFile::ZLFile() : myMimeTypeIsUpToDate(true), myInfoIsFilled(true) { } @@ -102,16 +108,20 @@ shared_ptr ZLFile::inputStream() const { int index = ZLFSManager::Instance().findArchiveFileNameDelimiter(myPath); if (index == -1) { - stream = ourPlainStreamCache[myPath]; +#if !FBREADER_DISABLE_ZLFILE_PLAIN_STREAM_CACHE + stream = ourPlainStreamCache[myPath]; if (stream.isNull()) { +#endif if (isDirectory()) { return 0; } stream = ZLFSManager::Instance().createPlainInputStream(myPath); stream = envelopeCompressedStream(stream); - ourPlainStreamCache[myPath] = stream; +#if !FBREADER_DISABLE_ZLFILE_PLAIN_STREAM_CACHE + ourPlainStreamCache[myPath] = stream; } - } else { +#endif + } else { ZLFile baseFile(myPath.substr(0, index)); shared_ptr base = baseFile.inputStream(); if (!base.isNull()) {