Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 27, 2023

Commits on Feb 23, 2023

  1. merge_batcher: use Rust iterators and VecDeque in place of VecQueue

    The standard library offers `VecDeque` which also has cheap (i.e non
    allocating) conversions to and from `Vec`s 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:
    
    ```rust
    let queue = VecQueue::new();
    queue.pop(); // UB, length isn't checked
    ```
    
    Signed-off-by: Petros Angelatos <[email protected]>
    petrosagg committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    032a4e3 View commit details
    Browse the repository at this point in the history