Skip to content

Commit 65b7319

Browse files
committed
Prefer fold_left over std::accumulate
This is a little more concise and also seems to fix the build with libc++ on clang (although on Linux there are still some weird linker errors). Ideally we would also test libc++ clang on the CI in addition to the libstdc++ clang we are testing right now. Fixes #15
1 parent 8da968d commit 65b7319

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Models/path_model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void PathModel::multiselect(int i) {
6666
void PathModel::refresh_folded_paths() {
6767
// only add multiselected items in multiselect mode
6868
auto v = paths | std::views::filter([&](const auto &i) { return !multiselected || i.multiselect; });
69-
folded_uri_list = std::accumulate(v.cbegin(), v.cend(), QString(), [](QString s, const auto p) { return s.append(QString::fromStdString(p.get_uri()) + "\r\n"); });
69+
folded_uri_list = std::ranges::fold_left(v, QString(), [](QString s, const auto p) { return s.append(QString::fromStdString(p.get_uri()) + "\r\n"); });
7070
emit foldedUriListChanged();
7171
}
7272

0 commit comments

Comments
 (0)