|
18 | 18 |
|
19 | 19 | #include <algorithm> |
20 | 20 | #include <array> |
21 | | -#include <cstring> |
| 21 | +#include <iterator> |
22 | 22 | #include <vector> |
23 | 23 |
|
24 | 24 | #include "replication/blob_send_utils.h" |
@@ -94,15 +94,15 @@ rdma_send_stream_base::buffer_fill_result rdma_socket_io::fill_blob_header_and_f |
94 | 94 | if (encoded.size() != blob_header_size) { |
95 | 95 | return {false, "encoded blob header size mismatch"}; |
96 | 96 | } |
97 | | - std::memcpy(buffer, encoded.data(), encoded.size()); |
| 97 | + std::copy(encoded.begin(), encoded.end(), buffer); |
98 | 98 | auto const payload_capacity = capacity - blob_header_size; |
99 | 99 | if (payload_capacity > 0U) { |
100 | 100 | // read_blob_chunk() returns only after reading the requested length; |
101 | 101 | // otherwise it throws, so bytes_read is intentionally not used here. |
102 | 102 | [[maybe_unused]] auto const bytes_read = read_blob_chunk( |
103 | 103 | fp, |
104 | 104 | path, |
105 | | - reinterpret_cast<char*>(buffer + blob_header_size), |
| 105 | + std::next(buffer, blob_header_size), |
106 | 106 | payload_capacity); |
107 | 107 | } |
108 | 108 | return {true, ""}; |
@@ -133,7 +133,7 @@ rdma_send_stream_base::buffer_fill_result rdma_socket_io::fill_blob_data_chunk( |
133 | 133 | // read_blob_chunk() returns only after reading the requested length; |
134 | 134 | // otherwise it throws, so bytes_read is intentionally not used here. |
135 | 135 | [[maybe_unused]] auto const bytes_read = |
136 | | - read_blob_chunk(fp, path, reinterpret_cast<char*>(buffer), capacity); |
| 136 | + read_blob_chunk(fp, path, buffer, capacity); |
137 | 137 | return {true, ""}; |
138 | 138 | } |
139 | 139 |
|
|
0 commit comments