From dc18051d8041982875b85ad62ad4dc752e96905c Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 17 Mar 2016 13:56:17 -0700 Subject: [PATCH] minor optimization: call vector.reserve [skip ci] --- plugins/input/csv/csv_utils.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/input/csv/csv_utils.cpp b/plugins/input/csv/csv_utils.cpp index ff75a46ed..c3818fd10 100644 --- a/plugins/input/csv/csv_utils.cpp +++ b/plugins/input/csv/csv_utils.cpp @@ -266,6 +266,7 @@ void csv_file_parser::parse_csv_and_boxes(std::istream & csv_file, boxes_type & { std::size_t index = 0; auto headers = csv_utils::parse_line(manual_headers_, separator_, quote_); + headers_.reserve(headers.size()); for (auto const& header : headers) { detail::locate_geometry_column(header, index++, locator_); @@ -284,6 +285,7 @@ void csv_file_parser::parse_csv_and_boxes(std::istream & csv_file, boxes_type & else { std::size_t index = 0; + headers_.reserve(headers.size()); for (auto & header : headers) { mapnik::util::trim(header);