util/ForeignFifoBuffer: use iterators
This commit is contained in:
parent
95e7f8b1c8
commit
93bf0fc547
@ -234,12 +234,13 @@ public:
|
|||||||
w = Write();
|
w = Write();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto n = std::min(r.size(), w.size());
|
if (r.size() > w.size())
|
||||||
|
r = r.first(w.size());
|
||||||
|
|
||||||
std::move(r.data(), r.data() + n, w.data());
|
std::move(r.begin(), r.end(), w.begin());
|
||||||
Append(n);
|
Append(r.size());
|
||||||
src.Consume(n);
|
src.Consume(r.size());
|
||||||
return n;
|
return r.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user