0

media: use emplace_back instead push_back in json_web_key

This is a followup of crrev.com/c/6244112 where a few clang
tidy hints were missed.

Change-Id: I9e64d7abbbed5d4628bf4d929226ce864a1f8c71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6246340
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1418235}
This commit is contained in:
Sorin Jianu
2025-02-10 10:10:28 -08:00
committed by Chromium LUCI CQ
parent 27aa1fa73f
commit 04206be2dc
2 changed files with 2 additions and 3 deletions

@ -276,8 +276,7 @@ bool ExtractKeyIdsFromKeyIdsInitData(const std::string& input,
}
// Add the decoded key ID to the list.
local_key_ids.push_back(
std::vector<uint8_t>(raw_key_id.begin(), raw_key_id.end()));
local_key_ids.emplace_back(raw_key_id.begin(), raw_key_id.end());
}
// All done.

@ -49,7 +49,7 @@ class JSONWebKeyTest : public testing::Test {
const std::string& expected_result) {
std::vector<uint8_t> result;
KeyIdList key_ids;
key_ids.push_back(std::vector<uint8_t>(key_id.begin(), key_id.end()));
key_ids.emplace_back(key_id.begin(), key_id.end());
CreateLicenseRequest(key_ids, session_type, &result);
std::string s(result.begin(), result.end());
EXPECT_EQ(expected_result, s);