@@ -77,19 +77,19 @@ class MatchAPI final : public RouteAPI
77
77
sub_routes[index].unpacked_path_segments ,
78
78
sub_routes[index].source_traversed_in_reverse ,
79
79
sub_routes[index].target_traversed_in_reverse );
80
- route.values [ " confidence" ] = sub_matchings[index].confidence ;
81
- routes.values .push_back (std::move (route));
80
+ route.values . emplace ( " confidence" , sub_matchings[index].confidence ) ;
81
+ routes.values .emplace_back (std::move (route));
82
82
}
83
83
if (!parameters.skip_waypoints )
84
84
{
85
- response.values [ " tracepoints" ] = MakeTracepoints (sub_matchings);
85
+ response.values . emplace ( " tracepoints" , MakeTracepoints (sub_matchings) );
86
86
}
87
- response.values [ " matchings" ] = std::move (routes);
88
- response.values [ " code" ] = " Ok" ;
87
+ response.values . emplace ( " matchings" , std::move (routes) );
88
+ response.values . emplace ( " code" , " Ok" ) ;
89
89
auto data_timestamp = facade.GetTimestamp ();
90
90
if (!data_timestamp.empty ())
91
91
{
92
- response.values [ " data_version" ] = data_timestamp;
92
+ response.values . emplace ( " data_version" , data_timestamp) ;
93
93
}
94
94
}
95
95
@@ -132,13 +132,13 @@ class MatchAPI final : public RouteAPI
132
132
133
133
if (tidy_result.can_be_removed [trace_index])
134
134
{
135
- waypoints.push_back (fbresult::WaypointBuilder (fb_result).Finish ());
135
+ waypoints.emplace_back (fbresult::WaypointBuilder (fb_result).Finish ());
136
136
continue ;
137
137
}
138
138
auto matching_index = trace_idx_to_matching_idx[trace_index];
139
139
if (matching_index.NotMatched ())
140
140
{
141
- waypoints.push_back (fbresult::WaypointBuilder (fb_result).Finish ());
141
+ waypoints.emplace_back (fbresult::WaypointBuilder (fb_result).Finish ());
142
142
continue ;
143
143
}
144
144
const auto &phantom =
@@ -165,7 +165,7 @@ class MatchAPI final : public RouteAPI
165
165
{
166
166
waypoint->add_waypoint_index (matching_index.point_index );
167
167
}
168
- waypoints.push_back (waypoint->Finish ());
168
+ waypoints.emplace_back (waypoint->Finish ());
169
169
}
170
170
171
171
return fb_result.CreateVector (waypoints);
@@ -186,23 +186,23 @@ class MatchAPI final : public RouteAPI
186
186
{
187
187
if (tidy_result.can_be_removed [trace_index])
188
188
{
189
- waypoints.values .push_back (util::json::Null ());
189
+ waypoints.values .emplace_back (util::json::Null ());
190
190
continue ;
191
191
}
192
192
auto matching_index = trace_idx_to_matching_idx[trace_index];
193
193
if (matching_index.NotMatched ())
194
194
{
195
- waypoints.values .push_back (util::json::Null ());
195
+ waypoints.values .emplace_back (util::json::Null ());
196
196
continue ;
197
197
}
198
198
const auto &phantom =
199
199
sub_matchings[matching_index.sub_matching_index ].nodes [matching_index.point_index ];
200
200
auto waypoint = BaseAPI::MakeWaypoint ({phantom});
201
- waypoint.values [ " matchings_index" ] = matching_index.sub_matching_index ;
202
- waypoint.values [ " waypoint_index" ] = matching_index.point_index ;
203
- waypoint.values [ " alternatives_count" ] =
204
- sub_matchings[matching_index.sub_matching_index ]
205
- .alternatives_count [matching_index.point_index ];
201
+ waypoint.values . emplace ( " matchings_index" , matching_index.sub_matching_index ) ;
202
+ waypoint.values . emplace ( " waypoint_index" , matching_index.point_index ) ;
203
+ waypoint.values . emplace ( " alternatives_count" ,
204
+ sub_matchings[matching_index.sub_matching_index ]
205
+ .alternatives_count [matching_index.point_index ]) ;
206
206
// waypoint indices need to be adjusted if route legs were collapsed
207
207
// waypoint parameter assumes there is only one match object
208
208
if (!parameters.waypoints .empty ())
@@ -217,7 +217,7 @@ class MatchAPI final : public RouteAPI
217
217
waypoint.values [" waypoint_index" ] = util::json::Null ();
218
218
}
219
219
}
220
- waypoints.values .push_back (std::move (waypoint));
220
+ waypoints.values .emplace_back (std::move (waypoint));
221
221
}
222
222
223
223
return waypoints;
0 commit comments