diff --git a/include/drives.h b/include/drives.h index 5f5b9e16..6a4e3b3d 100644 --- a/include/drives.h +++ b/include/drives.h @@ -22,7 +22,7 @@ #include "dosbox.h" #include -#include +#include #include #include @@ -83,8 +83,8 @@ protected: } srchInfo[MAX_OPENDIRS]; private: - virtual bool IsFirstEncounter(const std::string& filename); - std::set write_protected_files; + bool IsFirstEncounter(const std::string& filename); + std::unordered_set write_protected_files; struct { Bit16u bytes_sector; Bit8u sectors_cluster; diff --git a/src/dos/drive_local.cpp b/src/dos/drive_local.cpp index e49be66a..21a622a9 100644 --- a/src/dos/drive_local.cpp +++ b/src/dos/drive_local.cpp @@ -65,9 +65,9 @@ bool localDrive::FileCreate(DOS_File * * file,char * name,Bit16u /*attributes*/) } bool localDrive::IsFirstEncounter(const std::string& filename) { - const std::pair::iterator, bool> \ - ret(write_protected_files.insert(filename)); - return ret.second; + const auto ret = write_protected_files.insert(filename); + const bool was_inserted = ret.second; + return was_inserted; } bool localDrive::FileOpen(DOS_File** file, char * name, Bit32u flags) {