Skip to content

Commit a1a5d35

Browse files
Diff-fusionnilsding
authored andcommitted
Log path strings directly instead of accumulating
Signed-off-by: Felix <[email protected]>
1 parent 1565077 commit a1a5d35

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/libsync/syncengine.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -1216,12 +1216,14 @@ void SyncEngine::setLocalDiscoveryOptions(LocalDiscoveryStyle style, std::set<QS
12161216
_localDiscoveryStyle = style;
12171217
_localDiscoveryPaths = std::move(paths);
12181218

1219-
const auto allPaths = std::accumulate(_localDiscoveryPaths.begin(), _localDiscoveryPaths.end(), QString{}, [] (auto first, auto second) -> QString {
1220-
first += ", " + second;
1221-
return first;
1222-
});
1223-
1224-
qCInfo(lcEngine()) << "paths to discover locally" << allPaths;
1219+
if (lcEngine().isInfoEnabled()) {
1220+
// only execute if logging is enabled
1221+
auto debug = qInfo(lcEngine);
1222+
debug << "paths to discover locally";
1223+
for (auto path : _localDiscoveryPaths) {
1224+
debug << path;
1225+
}
1226+
}
12251227

12261228
// Normalize to make sure that no path is a contained in another.
12271229
// Note: for simplicity, this code consider anything less than '/' as a path separator, so for

0 commit comments

Comments
 (0)