Use iterator

This commit is contained in:
Uwe Seimet 2022-02-28 16:32:27 +01:00
parent 32511cc623
commit 22d173291f

View File

@ -27,8 +27,9 @@ void FileSupport::UnreserveFile()
bool FileSupport::GetIdsForReservedFile(const Filepath& path, int& id, int& unit)
{
if (reserved_files.find(path.GetPath()) != reserved_files.end()) {
const id_set ids = reserved_files[path.GetPath()];
const auto& it = reserved_files.find(path.GetPath());
if (it != reserved_files.end()) {
const id_set ids = it->second;
id = ids.first;
unit = ids.second;
return true;