forked from qt-creator/qt-creator
Remove some lambdas from Utils::transform calls
It is often possible to user (member) functions or members directly. That improves readablility and potentially reduces the total number of symbols. Also use qobject_container_cast at places where it is appropriate. Change-Id: Ia2591bca356591e001e2c53eeebcf753e5bc3c37 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -243,14 +243,14 @@ Id Id::versionedId(const QByteArray &prefix, int major, int minor)
|
||||
|
||||
QSet<Id> Id::fromStringList(const QStringList &list)
|
||||
{
|
||||
return QSet<Id>::fromList(Utils::transform(list, [](const QString &s) { return Id::fromString(s); }));
|
||||
return QSet<Id>::fromList(Utils::transform(list, &Id::fromString));
|
||||
}
|
||||
|
||||
QStringList Id::toStringList(const QSet<Id> &ids)
|
||||
{
|
||||
QList<Id> idList = ids.toList();
|
||||
Utils::sort(idList);
|
||||
return Utils::transform(idList, [](Id i) { return i.toString(); });
|
||||
return Utils::transform(idList, &Id::toString);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user