From ab472b748df4f1e96617c2e2531cc372b24f88f9 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 16 Sep 2021 21:54:22 +0200 Subject: [PATCH] Reduce C++ fancyness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 5.5 don’t like it. Revert once MXE catches up. Or not. --- event_filter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/event_filter.cpp b/event_filter.cpp index d3f5e17..68aa702 100644 --- a/event_filter.cpp +++ b/event_filter.cpp @@ -9,7 +9,8 @@ void EventFilter::setFilter(const QString& text) filters.clear(); if (!text.isEmpty()) { for (const auto &s : text.split(QRegularExpression{"\\s+"})) { - if (const int split = s.indexOf(":"); split == -1) + const int split = s.indexOf(":"); + if (split == -1) filters.append({"", s.trimmed()}); else filters.append({s.left(split).trimmed(), s.mid(split+1).trimmed()}); @@ -27,7 +28,8 @@ bool EventFilter::remove(int row) static bool matches(const QVariantMap& values, const QString& name, const QString& value) { for (auto kv = values.constKeyValueBegin(); kv != values.constKeyValueEnd(); kv++) { - const auto& [fieldName, fieldValue] = *kv; + const auto& fieldName = kv->first; + const auto& fieldValue = kv->second; if (!name.isEmpty() && !fieldName.startsWith(name)) continue;