diff --git a/silkworm/db/kv/grpc/client/remote_cursor.cpp b/silkworm/db/kv/grpc/client/remote_cursor.cpp index 6931d435c0..6f966ec4ac 100644 --- a/silkworm/db/kv/grpc/client/remote_cursor.cpp +++ b/silkworm/db/kv/grpc/client/remote_cursor.cpp @@ -49,10 +49,10 @@ Task RemoteCursor::seek(ByteView key) { seek_message.set_cursor(cursor_id_); seek_message.set_k(key.data(), key.length()); auto seek_pair = co_await tx_rpc_.write_and_read(seek_message); - const auto k = string_to_bytes(seek_pair.k()); - const auto v = string_to_bytes(seek_pair.v()); + auto k = string_to_bytes(seek_pair.k()); + auto v = string_to_bytes(seek_pair.v()); SILK_DEBUG << "RemoteCursor::seek k: " << k << " v: " << v << " c=" << cursor_id_ << " t=" << clock_time::since(start_time); - co_return api::KeyValue{k, v}; + co_return api::KeyValue{std::move(k), std::move(v)}; } Task RemoteCursor::seek_exact(ByteView key) { @@ -63,10 +63,10 @@ Task RemoteCursor::seek_exact(ByteView key) { seek_message.set_cursor(cursor_id_); seek_message.set_k(key.data(), key.length()); auto seek_pair = co_await tx_rpc_.write_and_read(seek_message); - const auto k = string_to_bytes(seek_pair.k()); - const auto v = string_to_bytes(seek_pair.v()); + auto k = string_to_bytes(seek_pair.k()); + auto v = string_to_bytes(seek_pair.v()); SILK_DEBUG << "RemoteCursor::seek_exact k: " << k << " v: " << v << " c=" << cursor_id_ << " t=" << clock_time::since(start_time); - co_return api::KeyValue{k, v}; + co_return api::KeyValue{std::move(k), std::move(v)}; } Task RemoteCursor::next() { @@ -75,10 +75,10 @@ Task RemoteCursor::next() { next_message.set_op(remote::Op::NEXT); next_message.set_cursor(cursor_id_); auto next_pair = co_await tx_rpc_.write_and_read(next_message); - const auto k = string_to_bytes(next_pair.k()); - const auto v = string_to_bytes(next_pair.v()); + auto k = string_to_bytes(next_pair.k()); + auto v = string_to_bytes(next_pair.v()); SILK_DEBUG << "RemoteCursor::next k: " << k << " v: " << v << " c=" << cursor_id_ << " t=" << clock_time::since(start_time); - co_return api::KeyValue{k, v}; + co_return api::KeyValue{std::move(k), std::move(v)}; } Task RemoteCursor::previous() { @@ -87,10 +87,10 @@ Task RemoteCursor::previous() { next_message.set_op(remote::Op::PREV); next_message.set_cursor(cursor_id_); auto next_pair = co_await tx_rpc_.write_and_read(next_message); - const auto k = string_to_bytes(next_pair.k()); - const auto v = string_to_bytes(next_pair.v()); + auto k = string_to_bytes(next_pair.k()); + auto v = string_to_bytes(next_pair.v()); SILK_DEBUG << "RemoteCursor::previous k: " << k << " v: " << v << " c=" << cursor_id_ << " t=" << clock_time::since(start_time); - co_return api::KeyValue{k, v}; + co_return api::KeyValue{std::move(k), std::move(v)}; } Task RemoteCursor::next_dup() { @@ -99,10 +99,10 @@ Task RemoteCursor::next_dup() { next_message.set_op(remote::Op::NEXT_DUP); next_message.set_cursor(cursor_id_); auto next_pair = co_await tx_rpc_.write_and_read(next_message); - const auto k = string_to_bytes(next_pair.k()); - const auto v = string_to_bytes(next_pair.v()); + auto k = string_to_bytes(next_pair.k()); + auto v = string_to_bytes(next_pair.v()); SILK_DEBUG << "RemoteCursor::next k: " << k << " v: " << v << " c=" << cursor_id_ << " t=" << clock_time::since(start_time); - co_return api::KeyValue{k, v}; + co_return api::KeyValue{std::move(k), std::move(v)}; } Task RemoteCursor::seek_both(ByteView key, ByteView value) { @@ -129,10 +129,10 @@ Task RemoteCursor::seek_both_exact(ByteView key, ByteView value) seek_message.set_k(key.data(), key.length()); seek_message.set_v(value.data(), value.length()); auto seek_pair = co_await tx_rpc_.write_and_read(seek_message); - const auto k = string_to_bytes(seek_pair.k()); - const auto v = string_to_bytes(seek_pair.v()); + auto k = string_to_bytes(seek_pair.k()); + auto v = string_to_bytes(seek_pair.v()); SILK_DEBUG << "RemoteCursor::seek_both_exact k: " << k << " v: " << v << " c=" << cursor_id_ << " t=" << clock_time::since(start_time); - co_return api::KeyValue{k, v}; + co_return api::KeyValue{std::move(k), std::move(v)}; } Task RemoteCursor::close_cursor() {