Merge pull request #7718 from Diff-fusion/improve-log-speed

Log path strings directly instead of accumulating
This commit is contained in:
Matthieu Gallien 2025-01-23 20:45:41 +01:00 committed by GitHub
commit 55059ec464
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1216,12 +1216,14 @@ void SyncEngine::setLocalDiscoveryOptions(LocalDiscoveryStyle style, std::set<QS
_localDiscoveryStyle = style;
_localDiscoveryPaths = std::move(paths);
const auto allPaths = std::accumulate(_localDiscoveryPaths.begin(), _localDiscoveryPaths.end(), QString{}, [] (auto first, auto second) -> QString {
first += ", " + second;
return first;
});
qCInfo(lcEngine()) << "paths to discover locally" << allPaths;
if (lcEngine().isInfoEnabled() && !_localDiscoveryPaths.empty()) {
// only execute if logging is enabled
auto debug = qInfo(lcEngine);
debug << "paths to discover locally";
for (auto path : _localDiscoveryPaths) {
debug << path;
}
}
// Normalize to make sure that no path is a contained in another.
// Note: for simplicity, this code consider anything less than '/' as a path separator, so for