Skip to content

Commit 9620d89

Browse files
burivuhvicpopov
authored andcommitted
fix for first pair of None events for a dict event
1 parent cc4c398 commit 9620d89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

snippets/c_api/iterate_events.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ processed on the Python side as lists of pairs while converting them to dicts.
132132
*/
133133
std::vector<char const *> getPairs(std::map<std::string, std::string> const & eventPairs)
134134
{
135-
std::vector<char const *> pairs(eventPairs.size() * 2);
135+
std::vector<char const *> pairs;
136+
pairs.reserve(eventPairs.size() * 2);
136137

137138
for (auto const & kp : eventPairs)
138139
{

0 commit comments

Comments
 (0)