diff options
| author | Tannin <devnull@localhost> | 2015-05-17 14:03:01 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-05-17 14:03:01 +0200 |
| commit | 268d2ffe8b533890b408740db1a6a3730dfd8597 (patch) | |
| tree | 889aec6383b1880cb99b3cd8ebe014485661d8e5 /src/executableslist.cpp | |
| parent | 9d3364f4da3fe77113147d9350c0e8c8c7f7a637 (diff) | |
- 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
Diffstat (limited to 'src/executableslist.cpp')
| -rw-r--r-- | src/executableslist.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<Executable>::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<Executable>::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");
|
