use structured binding declarations

Shorter.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-10-22 01:36:13 -07:00
committed by Max Kellermann
parent da642b2890
commit 44378b7dbe
14 changed files with 45 additions and 57 deletions

View File

@@ -402,8 +402,8 @@ CurlInputStream::CurlInputStream(EventLoop &event_loop, const char *_url,
{
request_headers.Append("Icy-Metadata: 1");
for (const auto &i : headers)
request_headers.Append((i.first + ":" + i.second).c_str());
for (const auto &[key, header] : headers)
request_headers.Append((key + ":" + header).c_str());
}
CurlInputStream::~CurlInputStream() noexcept

View File

@@ -174,8 +174,8 @@ QobuzClient::MakeUrl(const char *object, const char *method,
uri += method;
QueryStringBuilder q;
for (const auto &i : query)
q(uri, i.first.c_str(), i.second.c_str());
for (const auto &[key, url] : query)
q(uri, key.c_str(), url.c_str());
q(uri, "app_id", app_id);
return uri;
@@ -195,11 +195,11 @@ QobuzClient::MakeSignedUrl(const char *object, const char *method,
QueryStringBuilder q;
std::string concatenated_query(object);
concatenated_query += method;
for (const auto &i : query) {
q(uri, i.first.c_str(), i.second.c_str());
for (const auto &[key, url] : query) {
q(uri, key.c_str(), url.c_str());
concatenated_query += i.first;
concatenated_query += i.second;
concatenated_query += key;
concatenated_query += url;
}
q(uri, "app_id", app_id);