diff options
| author | Stefan Boberg <[email protected]> | 2026-02-24 13:36:44 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2026-02-24 13:36:44 +0100 |
| commit | 075bac3ca870a1297e9f62230d56e63aec13a77d (patch) | |
| tree | 367a820685a829adbab31cd1374b1af2cece4b7e /src/zenserver/frontend/zipfs.cpp | |
| parent | Fix correctness and concurrency bugs found during code review (diff) | |
| download | zen-075bac3ca870a1297e9f62230d56e63aec13a77d.tar.xz zen-075bac3ca870a1297e9f62230d56e63aec13a77d.zip | |
Revert "Fix correctness and concurrency bugs found during code review"
This reverts commit 3c89c486338890ce39ddebe5be4722a09e85701a.
Diffstat (limited to 'src/zenserver/frontend/zipfs.cpp')
| -rw-r--r-- | src/zenserver/frontend/zipfs.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/zenserver/frontend/zipfs.cpp b/src/zenserver/frontend/zipfs.cpp index 42df0520f..f9c2bc8ff 100644 --- a/src/zenserver/frontend/zipfs.cpp +++ b/src/zenserver/frontend/zipfs.cpp @@ -149,25 +149,13 @@ ZipFs::ZipFs(IoBuffer&& Buffer) IoBuffer ZipFs::GetFile(const std::string_view& FileName) const { + FileMap::iterator Iter = m_Files.find(FileName); + if (Iter == m_Files.end()) { - RwLock::SharedLockScope _(m_FilesLock); - - FileMap::const_iterator Iter = m_Files.find(FileName); - if (Iter == m_Files.end()) - { - return {}; - } - - const FileItem& Item = Iter->second; - if (Item.GetSize() > 0) - { - return IoBuffer(IoBuffer::Wrap, Item.GetData(), Item.GetSize()); - } + return {}; } - RwLock::ExclusiveLockScope _(m_FilesLock); - - FileItem& Item = m_Files.find(FileName)->second; + FileItem& Item = Iter->second; if (Item.GetSize() > 0) { return IoBuffer(IoBuffer::Wrap, Item.GetData(), Item.GetSize()); |