From 268d2ffe8b533890b408740db1a6a3730dfd8597 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 17 May 2015 14:03:01 +0200 Subject: - some code cleanup and modernization trying to fix "dr memory" reports (though they were almost certainly false positives) - there is now a 50ms timeout on logging messages - bugfix: leaked handles after directory searches --- src/executableslist.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/executableslist.cpp') diff --git a/src/executableslist.cpp b/src/executableslist.cpp index 1852b0ad..badf0813 100644 --- a/src/executableslist.cpp +++ b/src/executableslist.cpp @@ -113,9 +113,9 @@ const Executable &ExecutablesList::find(const QString &title) const Executable &ExecutablesList::find(const QString &title) { - for (std::vector::iterator iter = m_Executables.begin(); iter != m_Executables.end(); ++iter) { - if (QString::compare(iter->m_Title, title, Qt::CaseInsensitive) == 0) { - return *iter; + for (Executable &exe : m_Executables) { + if (QString::compare(exe.m_Title, title, Qt::CaseInsensitive) == 0) { + return exe; } } throw std::runtime_error("invalid name"); @@ -124,9 +124,9 @@ Executable &ExecutablesList::find(const QString &title) Executable &ExecutablesList::findByBinary(const QFileInfo &info) { - for (std::vector::iterator iter = m_Executables.begin(); iter != m_Executables.end(); ++iter) { - if (info == iter->m_BinaryInfo) { - return *iter; + for (Executable &exe : m_Executables) { + if (info == exe.m_BinaryInfo) { + return exe; } } throw std::runtime_error("invalid info"); -- cgit v1.3.1