TimelyDataflow / differential-dataflow

An implementation of differential dataflow using timely dataflow on Rust.
MIT License
2.54k stars 183 forks source link

merge_batcher: use Rust iterators and `VecDeque` in place of `VecQueue` #380

Closed petrosagg closed 1 year ago

petrosagg commented 1 year ago

The standard library offers VecDeque which also has cheap (i.e non allocating) conversions to and from Vecs so we can use that directly and reduce the number of unsafe calls in the project.

Note that while all uses of the API of VecQueue were correct its methods were marked as safe but you could accidentally cause undefined behavior:

let queue = VecQueue::new();
queue.pop(); // UB, length isn't checked