Skip to content

Commit

Permalink
future-util: do not "return move(local_var)"
Browse files Browse the repository at this point in the history
GCC and clang warns like

warning: moving a local object in a return statement prevents copy
elision [-Wpessimizing-move]
  580 |             return std::move(f);
      |                               ^

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Mar 21, 2019
1 parent f9e43c3 commit 23c9610
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/seastar/core/future-util.hh
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ future<> do_for_each(Iterator begin, Iterator end, AsyncAction action) {
});
}
if (f.failed()) {
return std::move(f);
return f;
}
}
}
Expand Down

0 comments on commit 23c9610

Please sign in to comment.