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

src: prefer data accessor of string and vector #47750

Merged
merged 1 commit into from
May 3, 2023

Commits on May 3, 2023

  1. src: prefer data accessor of string and vector

    The pattern of getting the address of the element at index 0 of a
    container is generally used to materialize a pointer to the backing
    data of a container, however `std::string` and `std::vector`
    provide a `data()` accessor to retrieve the data pointer which
    should be preferred.
    
    This also ensures that in the case that the container is empty, the
    data pointer access does not perform an errant memory access.
    VoltrexKeyva committed May 3, 2023
    Configuration menu
    Copy the full SHA
    94ca84f View commit details
    Browse the repository at this point in the history