From 835ff7e692932187e1e4e4d87d21b9328db7713a Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 14 Aug 2019 12:32:11 +0200 Subject: [PATCH] Use pointer to member or member function with transform ... when possible. More compact. Change-Id: I81410b7e6d523b9405c87f70a474ded1fa9ce960 Reviewed-by: Eike Ziller --- src/libs/clangsupport/clangpathwatcher.h | 4 +--- src/plugins/vcsbase/vcsbaseclientsettings.cpp | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libs/clangsupport/clangpathwatcher.h b/src/libs/clangsupport/clangpathwatcher.h index 5ce02458c43..d7d3aee7e8e 100644 --- a/src/libs/clangsupport/clangpathwatcher.h +++ b/src/libs/clangsupport/clangpathwatcher.h @@ -390,9 +390,7 @@ public: FilePathIds watchedPaths(const WatcherEntries &entries) const { - auto filePathIds = Utils::transform(entries, [](WatcherEntry entry) { - return entry.filePathId; - }); + auto filePathIds = Utils::transform(entries, &WatcherEntry::filePathId); std::sort(filePathIds.begin(), filePathIds.end()); diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index ebf81d5123d..60bd7548259 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -354,8 +354,7 @@ QVariant::Type VcsBaseClientSettings::valueType(const QString &key) const FilePath VcsBaseClientSettings::binaryPath() const { if (d->m_binaryFullPath.isEmpty()) { - const FilePathList searchPaths - = Utils::transform(searchPathList(), [](const QString &s) { return FilePath::fromString(s); }); + const FilePathList searchPaths = Utils::transform(searchPathList(), &FilePath::fromString); d->m_binaryFullPath = Environment::systemEnvironment().searchInPath( stringValue(binaryPathKey), searchPaths); }