More template bloat reduction

This commit is contained in:
Nicolas Werner 2023-02-20 01:04:49 +01:00
parent a1c4889339
commit ac4c9e024e
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
4 changed files with 116 additions and 108 deletions

View file

@ -212,13 +212,10 @@ Cache::isHiddenEvent(lmdb::txn &txn,
hiddenEvents = std::move(h.content);
}
return std::visit(
[hiddenEvents](const auto &ev) {
return std::any_of(hiddenEvents.hidden_event_types->begin(),
hiddenEvents.hidden_event_types->end(),
[ev](EventType type) { return type == ev.type; });
},
e);
return std::find(hiddenEvents.hidden_event_types->begin(),
hiddenEvents.hidden_event_types->end(),
std::visit([](const auto &ev) { return ev.type; }, e)) !=
hiddenEvents.hidden_event_types->end();
}
Cache::Cache(const QString &userId, QObject *parent)