Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
| ../git/src/netlink/nl_l3.cc:46:21: warning: loop variable 'v' creates a copy from type 'const basebox::nh_stub' [-Wrange-loop-construct]
|    46 |     for (const auto v : arg) {
|       |                     ^
| ../git/src/netlink/nl_l3.cc:46:21: note: use reference type to prevent copying
|    46 |     for (const auto v : arg) {
|       |                     ^
|       |                     &

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
  • Loading branch information
KanjiMonster committed May 2, 2024
1 parent b596a04 commit 7fcd1e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/netlink/nl_l3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ template <class T, class A> struct hash<std::set<T, A>> {
using result_type = std::size_t;
result_type operator()(argument_type const &arg) const noexcept {
result_type seed = 0;
for (const auto v : arg) {
for (const auto &v : arg) {
hash_combine(seed, v);
}
return seed;
Expand Down

0 comments on commit 7fcd1e4

Please sign in to comment.