Switch write protected set to unordered_set
This commit is contained in:
parent
b302b535c3
commit
6c0e1a4607
2 changed files with 6 additions and 6 deletions
|
@ -22,7 +22,7 @@
|
|||
#include "dosbox.h"
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
@ -83,8 +83,8 @@ protected:
|
|||
} srchInfo[MAX_OPENDIRS];
|
||||
|
||||
private:
|
||||
virtual bool IsFirstEncounter(const std::string& filename);
|
||||
std::set<std::string> write_protected_files;
|
||||
bool IsFirstEncounter(const std::string& filename);
|
||||
std::unordered_set<std::string> write_protected_files;
|
||||
struct {
|
||||
Bit16u bytes_sector;
|
||||
Bit8u sectors_cluster;
|
||||
|
|
|
@ -65,9 +65,9 @@ bool localDrive::FileCreate(DOS_File * * file,char * name,Bit16u /*attributes*/)
|
|||
}
|
||||
|
||||
bool localDrive::IsFirstEncounter(const std::string& filename) {
|
||||
const std::pair<std::set<std::string>::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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue