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

Avoid extraneous call to remaining in get_u8/i8 #490

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Mar 5, 2021

  1. Avoid extraneous call to remaining in get_u8/i8

    I have a chained datastructure that can dereference into a slice quite fast, but remaining requires walking the chain, which is relatively slow.
    
    I would hazard a guess that this is the more common perf characteristic of non-contiguous impls of Buf. 
    
    Separately, this brings these impls in line with all the other get_ impls, which have a fast path with [u8].get(...), which does the same bounds check that I do in this patch
    
    I think clippy will say to use non_empty, here, I think in this case this is more clear, but I will do whatever is preferred.
    guswynn committed Mar 5, 2021
    Configuration menu
    Copy the full SHA
    4db4e21 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2a6cc0f View commit details
    Browse the repository at this point in the history