Skip to content

Commit

Permalink
Fix unneeded copies in range some range for loops:
Browse files Browse the repository at this point in the history
clang 10 warns about an unneeded copy for these range for
loops (range-loop-construct warnings)
  • Loading branch information
seelabs authored and manojsdoshi committed Apr 7, 2020
1 parent d097819 commit ade5eb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/test/app/PayChan_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ struct PayChan_test : public beast::unit_test::suite

Env env(*this);
env.fund(XRP(10000), alice);
for (auto const a : bobs)
for (auto const& a : bobs)
{
env.fund(XRP(10000), a);
env.close();
Expand All @@ -956,7 +956,7 @@ struct PayChan_test : public beast::unit_test::suite
// create a channel from alice to every bob account
auto const settleDelay = 3600s;
auto const channelFunds = XRP(1);
for (auto const b : bobs)
for (auto const& b : bobs)
{
env(create(alice, b, channelFunds, settleDelay, alice.pk()));
}
Expand Down Expand Up @@ -990,7 +990,7 @@ struct PayChan_test : public beast::unit_test::suite

auto const bobsB58 = [&bobs]() -> std::set<std::string> {
std::set<std::string> r;
for (auto const a : bobs)
for (auto const& a : bobs)
r.insert(a.human());
return r;
}();
Expand Down
2 changes: 1 addition & 1 deletion src/test/rpc/AccountCurrencies_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class AccountCurrencies_test : public beast::unit_test::suite
// does not change
env(trust(alice, gw["USD"](100), tfSetFreeze));
result = env.rpc ("account_lines", alice.human());
for (auto const l : result[jss::lines])
for (auto const& l : result[jss::lines])
BEAST_EXPECT(
l[jss::freeze].asBool() == (l[jss::currency] == "USD"));
result = env.rpc ("json", "account_currencies",
Expand Down

0 comments on commit ade5eb7

Please sign in to comment.