From f0d2dd20803f2eee364d26656715b89e7c74366c Mon Sep 17 00:00:00 2001 From: David Redondo Date: Wed, 27 Aug 2025 09:40:43 +0200 Subject: [PATCH] servicerunner: use vector::insert on compilers that don't support append_range yet g++ only gained support for it with g++ 15 which was released this month. --- runners/services/servicerunner.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runners/services/servicerunner.cpp b/runners/services/servicerunner.cpp index 2ccc9a0af37..9e9d4e70a72 100644 --- a/runners/services/servicerunner.cpp +++ b/runners/services/servicerunner.cpp @@ -142,7 +142,11 @@ auto makeScoreFromList(const auto &queryList, const QStringList &strings) { continue; // Not a good match, skip it. We are very strict with keywords } found = true; +#ifdef __cpp_lib_containers_ranges queryCards.append_range(stringCards); +#else + queryCards.insert(queryCards.end(), stringCards.cbegin(), stringCards.cend()); +#endif } // We do not break because other string might also match, improving the score. } @@ -150,7 +154,11 @@ auto makeScoreFromList(const auto &queryList, const QStringList &strings) { // No item in strings matched the query item. This means the entire query is not a match. return ScoreCards{}; } +#ifdef __cpp_lib_containers_ranges cards.append_range(queryCards); +#else + cards.insert(cards.end(), queryCards.cbegin(), queryCards.cend()); +#endif } return cards; }; -- GitLab