@@ -61,7 +61,7 @@ struct DomainRangeLatestQuery {
61
61
return decode_kv_pair (kv_pair);
62
62
};
63
63
64
- auto exec_with_eager_begin (Bytes key_start, Bytes key_end, bool ascending) {
64
+ auto exec_with_eager_begin (const Bytes& key_start, Bytes key_end, bool ascending) {
65
65
SILKWORM_ASSERT (ascending); // descending is not implemented
66
66
67
67
using CursorKVIteratorRaw = CursorKVIterator<DomainKeyDecoder<RawDecoder<ByteView>>, DomainValueDecoder<RawDecoder<ByteView>>>;
@@ -101,12 +101,12 @@ struct DomainRangeLatestQuery {
101
101
TKeyEncoder key_start_encoder;
102
102
key_start_encoder.value = key_start;
103
103
Slice key_start_slice = key_start_encoder.encode ();
104
- Bytes key_start_data = Bytes{from_slice (key_start_slice)};
104
+ Bytes key_start_data = Bytes{from_slice (key_start_slice)}; // TODO(canepat) extract data from encoder instead of copying
105
105
106
106
TKeyEncoder key_end_encoder;
107
107
key_end_encoder.value = key_end;
108
108
Slice key_end_slice = key_end_encoder.encode ();
109
- Bytes key_end_data = Bytes{from_slice (key_end_slice)};
109
+ Bytes key_end_data = Bytes{from_slice (key_end_slice)}; // TODO(canepat) extract data from encoder instead of copying
110
110
111
111
auto exec_func = [query = *this , key_start = std::move (key_start_data), key_end = std::move (key_end_data), ascending]() mutable {
112
112
return query.exec_with_eager_begin (std::move (key_start), std::move (key_end), ascending);
0 commit comments