From 11ff6da984479f9cf855af21eec6a5d2c8dab19b Mon Sep 17 00:00:00 2001 From: silverqx Date: Wed, 14 Aug 2024 00:51:04 +0200 Subject: [PATCH] used for-ranged loop --- src/orm/utils/string.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/orm/utils/string.cpp b/src/orm/utils/string.cpp index 0874a535e..164e163ca 100644 --- a/src/orm/utils/string.cpp +++ b/src/orm/utils/string.cpp @@ -188,9 +188,7 @@ QString String::snake(QString string, const QChar delimiter) } // Positions stay valid after inserts because reverse iterators used - std::ranges::for_each(positions.crbegin(), positions.crend(), - [&string, delimiter](const QString::size_type pos) - { + for (const QString::size_type pos : positions | ranges::views::reverse) { const auto previousPos = pos - 1; // Change space to _ @@ -199,7 +197,7 @@ QString String::snake(QString string, const QChar delimiter) // Prepend the _ before A-Z else string.insert(pos, delimiter); - }); + } return (*snakeCache)[std::move(key)] = string.replace(SPACE, EMPTY).toLower(); }