convert const ref to value

clang-tidy wrongly sees an std::move to a const ref parameter and
believes it to be pointless. The copy constructor however is deleted.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2021-08-17 13:56:07 -07:00 committed by Johannes Altmanninger
parent 4ea5189c4f
commit ffa3e0b4f4
4 changed files with 4 additions and 4 deletions

View File

@ -199,7 +199,7 @@ void fd_monitor_t::run_in_background() {
}
}
void fd_monitor_t::poke_in_background(const poke_list_t &pokelist) {
void fd_monitor_t::poke_in_background(poke_list_t pokelist) {
ASSERT_IS_BACKGROUND_THREAD();
auto poker = [&pokelist](fd_monitor_item_t &item) {
int fd = item.fd.fd();

View File

@ -110,7 +110,7 @@ class fd_monitor_t {
// Poke items in the pokelist, removing any items that close their FD.
// The pokelist is consumed after this.
// This is only called in the background thread.
void poke_in_background(const poke_list_t &pokelist);
void poke_in_background(poke_list_t pokelist);
// The list of items to monitor. This is only accessed on the background thread.
item_list_t items_{};

View File

@ -282,7 +282,7 @@ shared_ptr<const io_data_t> io_chain_t::io_for_fd(int fd) const {
return nullptr;
}
void output_stream_t::append_narrow_buffer(const separated_buffer_t &buffer) {
void output_stream_t::append_narrow_buffer(separated_buffer_t buffer) {
for (const auto &rhs_elem : buffer.elements()) {
append_with_separation(str2wcstring(rhs_elem.contents), rhs_elem.separation);
}

View File

@ -381,7 +381,7 @@ class output_stream_t : noncopyable_t, nonmovable_t {
void push_back(wchar_t c) { append(c); }
// Append data from a narrow buffer, widening it.
void append_narrow_buffer(const separated_buffer_t &buffer);
void append_narrow_buffer(separated_buffer_t buffer);
/// Append a format string.
void append_format(const wchar_t *format, ...) {