mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 09:30:45 +00:00
virtio: convert vring::post() to accept an iterator to a range
Instead of an iterator to a vector of buffers, accept an iterator to a container of buffers, increasing flexibility for callers.
This commit is contained in:
@@ -271,7 +271,10 @@ void vring::run() {
|
||||
|
||||
template <typename Iterator>
|
||||
void vring::post(Iterator begin, Iterator end) {
|
||||
std::for_each(begin, end, [&] (buffer_chain& bc) {
|
||||
// Note: buffer_chain here is any container of buffer, not
|
||||
// necessarily vector<buffer>.
|
||||
using buffer_chain = decltype(*begin);
|
||||
std::for_each(begin, end, [this] (buffer_chain bc) {
|
||||
bool has_prev = false;
|
||||
unsigned prev_desc_idx = 0;
|
||||
for (auto i = bc.rbegin(); i != bc.rend(); ++i) {
|
||||
|
||||
Reference in New Issue
Block a user