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

AS::Map function improvement #1642

Merged
merged 2 commits into from
Oct 23, 2019

Commits on Oct 23, 2019

  1. Prefer reserve rather than fill constructor in AS::map()

    `fill constructor` constructs the vector with n elements and initializes each element with its default constructor. Instead, `reserve` just allocates memory, no element is initialized and put into the vector, so it's more effeicent. For example, after running the `result_type res(iterable.size());` statement, the `res` vector's size is equal to `iterable.size()`, but after running the `res.reserve(iterable.size());` statement, the `res` vector's size is 0.
    hanton committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    08a8b5c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d15e600 View commit details
    Browse the repository at this point in the history