Reduce C++ fancyness

GCC 5.5 don’t like it. Revert once MXE catches up. Or not.
This commit is contained in:
Timotej Lazar 2021-09-16 21:54:22 +02:00
parent ca524131a5
commit ab472b748d
No known key found for this signature in database
GPG key ID: B6F38793D143456F

View file

@ -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;