From f6425135877444779b178ba5ee85ae7b304b6439 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 7 Sep 2024 15:34:58 +0200 Subject: [PATCH] StreamingSearchView: Use const_iterator --- src/streaming/streamingsearchview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/streaming/streamingsearchview.cpp b/src/streaming/streamingsearchview.cpp index e2af60930..7b006daf1 100644 --- a/src/streaming/streamingsearchview.cpp +++ b/src/streaming/streamingsearchview.cpp @@ -363,8 +363,8 @@ bool StreamingSearchView::ResultsContextMenuEvent(QContextMenuEvent *e) { void StreamingSearchView::timerEvent(QTimerEvent *e) { - QMap::iterator it = delayed_searches_.find(e->timerId()); - if (it != delayed_searches_.end()) { + QMap::const_iterator it = delayed_searches_.constFind(e->timerId()); + if (it != delayed_searches_.constEnd()) { SearchAsync(it.value().id_, it.value().query_, it.value().type_); delayed_searches_.erase(it); return; @@ -518,7 +518,7 @@ void StreamingSearchView::SearchDone(const int service_id, const SongMap &songs, void StreamingSearchView::CancelSearch(const int id) { - for (QMap::iterator it = delayed_searches_.begin(); it != delayed_searches_.end(); ++it) { + for (QMap::const_iterator it = delayed_searches_.constBegin(); it != delayed_searches_.constEnd(); ++it) { if (it.value().id_ == id) { killTimer(it.key()); delayed_searches_.erase(it);