From bff3d33fc306307bf284c11a742fb0e3c9e67634 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Sun, 23 Aug 2015 00:16:03 +0200 Subject: [PATCH] Don't detach and create temporary QLists when there's no need --- src/libdanbooru/utils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libdanbooru/utils.cpp b/src/libdanbooru/utils.cpp index 9e1a0b5..2464fd9 100644 --- a/src/libdanbooru/utils.cpp +++ b/src/libdanbooru/utils.cpp @@ -49,8 +49,8 @@ QUrl requestUrl(QUrl &url, const QString &path, if (!parameters.isEmpty()) { - for (auto key : parameters.keys()) { - query.addQueryItem(key, parameters.value(key)); + for (auto it = parameters.cbegin(), e = parameters.cend(); it != e; ++it) { + query.addQueryItem(it.key(), it.value()); } } @@ -85,8 +85,8 @@ QUrl requestUrl(QUrl &url, const QString &path, const QString &username, if (!parameters.isEmpty()) { - for (auto key : parameters.keys()) { - query.addQueryItem(key, parameters.value(key)); + for (auto it = parameters.cbegin(), e = parameters.cend(); it != e; ++it) { + query.addQueryItem(it.key(), it.value()); } }