Skip to content

Commit 907d7f8

Browse files
committed
Use reference in range-based for loop
1 parent b6da677 commit 907d7f8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/rules_exceptions.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ bool RulesExceptions::contains(int a) {
195195
}
196196
}
197197

198-
for (auto z : m_ranges) {
198+
for (auto& z : m_ranges) {
199199
if (z.first <= a && z.second >= a) {
200200
return true;
201201
}
@@ -212,7 +212,7 @@ bool RulesExceptions::merge(RulesExceptions *from) {
212212
return ret;
213213
}
214214
}
215-
for (auto b : from->m_ranges) {
215+
for (auto& b : from->m_ranges) {
216216
bool ret = addRange(b.first, b.second);
217217
if (ret == false) {
218218
return ret;

src/transaction.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ std::string Transaction::toJSON(int parts) {
17001700
reinterpret_cast<const unsigned char*>("messages"),
17011701
strlen("messages"));
17021702
yajl_gen_array_open(g);
1703-
for (auto a : m_rulesMessages) {
1703+
for (auto& a : m_rulesMessages) {
17041704
yajl_gen_map_open(g);
17051705
LOGFY_ADD("message", a.m_message);
17061706
yajl_gen_string(g,
@@ -1721,7 +1721,7 @@ std::string Transaction::toJSON(int parts) {
17211721
reinterpret_cast<const unsigned char*>("tags"),
17221722
strlen("tags"));
17231723
yajl_gen_array_open(g);
1724-
for (auto b : a.m_tags) {
1724+
for (auto& b : a.m_tags) {
17251725
yajl_gen_string(g,
17261726
reinterpret_cast<const unsigned char*>(b.data()),
17271727
b.length());

0 commit comments

Comments
 (0)