Skip to content

Commit 074578b

Browse files
committed
refactor(task): use asKeyValueRange() for Qt container iteration
This improves iteration over the compilerConfiguration map by replacing toStdMap() with asKeyValueRange(). This Qt 6+ feature provides a lightweight view over the container's key-value pairs, eliminating the unnecessary intermediate std::map allocation. (cherry picked from commit 6eb9c90)
1 parent ad75478 commit 074578b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/core/task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ int Task::writeToJson(QJsonObject &in) {
288288
}
289289

290290
QJsonObject compilerConfiguration;
291-
for (auto [x, y] : this->compilerConfiguration.toStdMap()) {
291+
for (auto [x, y] : this->compilerConfiguration.asKeyValueRange()) {
292292
compilerConfiguration[x] = y;
293293
}
294294
WRITE_JSON(in, compilerConfiguration);

0 commit comments

Comments
 (0)