From 9620d8922b67c3d355deb1988898995dab86cea3 Mon Sep 17 00:00:00 2001 From: burivuh Date: Wed, 11 Sep 2019 17:13:58 +0300 Subject: [PATCH] fix for first pair of None events for a dict event --- snippets/c_api/iterate_events.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snippets/c_api/iterate_events.cc b/snippets/c_api/iterate_events.cc index ccbf186..10474f4 100644 --- a/snippets/c_api/iterate_events.cc +++ b/snippets/c_api/iterate_events.cc @@ -132,7 +132,8 @@ processed on the Python side as lists of pairs while converting them to dicts. */ std::vector getPairs(std::map const & eventPairs) { - std::vector pairs(eventPairs.size() * 2); + std::vector pairs; + pairs.reserve(eventPairs.size() * 2); for (auto const & kp : eventPairs) {