Skip to content

Commit dc90a09

Browse files
committed
review: fix clang-tidy errors.
Signed-off-by: Piotr Sikora <[email protected]>
1 parent 9dec346 commit dc90a09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pairs_util.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ using Sizes = std::vector<std::pair<uint32_t, uint32_t>>;
2828

2929
size_t PairsUtil::pairsSize(const Pairs &pairs) {
3030
size_t size = sizeof(uint32_t); // number of headers
31-
for (auto &p : pairs) {
31+
for (const auto &p : pairs) {
3232
size += 2 * sizeof(uint32_t); // size of name, size of value
3333
size += p.first.size() + 1; // NULL-terminated name
3434
size += p.second.size() + 1; // NULL-terminated value
@@ -52,7 +52,7 @@ bool PairsUtil::marshalPairs(const Pairs &pairs, char *buffer, size_t size) {
5252
::memcpy(pos, &num_pairs, sizeof(uint32_t));
5353
pos += sizeof(uint32_t);
5454

55-
for (auto &p : pairs) {
55+
for (const auto &p : pairs) {
5656
// Write name length.
5757
uint32_t name_len = htowasm(p.first.size());
5858
if (pos + sizeof(uint32_t) > end) {
@@ -70,7 +70,7 @@ bool PairsUtil::marshalPairs(const Pairs &pairs, char *buffer, size_t size) {
7070
pos += sizeof(uint32_t);
7171
}
7272

73-
for (auto &p : pairs) {
73+
for (const auto &p : pairs) {
7474
// Write name.
7575
if (pos + p.first.size() + 1 > end) {
7676
return false;

0 commit comments

Comments
 (0)