From 22d173291f488e02a220968d6076e6a3fc11b398 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Mon, 28 Feb 2022 16:32:27 +0100 Subject: [PATCH] Use iterator --- src/raspberrypi/devices/file_support.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/raspberrypi/devices/file_support.cpp b/src/raspberrypi/devices/file_support.cpp index 09b9061a..572371f6 100644 --- a/src/raspberrypi/devices/file_support.cpp +++ b/src/raspberrypi/devices/file_support.cpp @@ -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;