[ox/ptrarith] Fix NodeBuffer::compact to iterate over items when item already in correct location
This commit is contained in:
parent
d55089b582
commit
31b75d1e50
2
deps/ox/src/ox/ptrarith/nodebuffer.hpp
vendored
2
deps/ox/src/ox/ptrarith/nodebuffer.hpp
vendored
@ -357,7 +357,7 @@ template<typename F>
|
|||||||
void NodeBuffer<size_t, Item>::compact(F cb) {
|
void NodeBuffer<size_t, Item>::compact(F cb) {
|
||||||
auto src = firstItem();
|
auto src = firstItem();
|
||||||
auto dest = ptr(sizeof(*this));
|
auto dest = ptr(sizeof(*this));
|
||||||
while (src.valid() && dest.valid() && dest.offset() < src.offset()) {
|
while (src.valid() && dest.valid() && dest.offset() <= src.offset()) {
|
||||||
// move node
|
// move node
|
||||||
ox_memcpy(dest, src, src.size());
|
ox_memcpy(dest, src, src.size());
|
||||||
cb(src, dest);
|
cb(src, dest);
|
||||||
|
Loading…
Reference in New Issue
Block a user