forked from qt-creator/qt-creator
Use pointer to member or member function with transform
... when possible. More compact. Change-Id: I81410b7e6d523b9405c87f70a474ded1fa9ce960 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -390,9 +390,7 @@ public:
|
|||||||
|
|
||||||
FilePathIds watchedPaths(const WatcherEntries &entries) const
|
FilePathIds watchedPaths(const WatcherEntries &entries) const
|
||||||
{
|
{
|
||||||
auto filePathIds = Utils::transform<FilePathIds>(entries, [](WatcherEntry entry) {
|
auto filePathIds = Utils::transform<FilePathIds>(entries, &WatcherEntry::filePathId);
|
||||||
return entry.filePathId;
|
|
||||||
});
|
|
||||||
|
|
||||||
std::sort(filePathIds.begin(), filePathIds.end());
|
std::sort(filePathIds.begin(), filePathIds.end());
|
||||||
|
|
||||||
|
@@ -354,8 +354,7 @@ QVariant::Type VcsBaseClientSettings::valueType(const QString &key) const
|
|||||||
FilePath VcsBaseClientSettings::binaryPath() const
|
FilePath VcsBaseClientSettings::binaryPath() const
|
||||||
{
|
{
|
||||||
if (d->m_binaryFullPath.isEmpty()) {
|
if (d->m_binaryFullPath.isEmpty()) {
|
||||||
const FilePathList searchPaths
|
const FilePathList searchPaths = Utils::transform(searchPathList(), &FilePath::fromString);
|
||||||
= Utils::transform(searchPathList(), [](const QString &s) { return FilePath::fromString(s); });
|
|
||||||
d->m_binaryFullPath = Environment::systemEnvironment().searchInPath(
|
d->m_binaryFullPath = Environment::systemEnvironment().searchInPath(
|
||||||
stringValue(binaryPathKey), searchPaths);
|
stringValue(binaryPathKey), searchPaths);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user