Skip to content

Commit

Permalink
Log path strings directly instead of accumulating
Browse files Browse the repository at this point in the history
Signed-off-by: Felix <felix-git@0xf.eu>
  • Loading branch information
Diff-fusion committed Jan 4, 2025
1 parent 5af3c88 commit 2c61556
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
// 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
Expand Down

0 comments on commit 2c61556

Please sign in to comment.