Optimizing FB schema:

* Replaced Response union with nullable fields
* "Ok" code replaced with a boolean and a separate structure for a error code and message.
* Inlined geometry, thus removing one layer of indirection.
This commit is contained in:
Denis Chaplygin
2019-08-08 11:46:25 +03:00
parent affa8a4653
commit 13287d9970
7 changed files with 335 additions and 605 deletions
+1 -3
View File
@@ -71,8 +71,6 @@ class TableAPI final : public BaseAPI
auto number_of_destinations = parameters.destinations.size();
fbresult::FBResultBuilder response(fb_result);
response.add_code(fb_result.CreateString("Ok"));
response.add_response_type(osrm::engine::api::fbresult::ServiceResponse::ServiceResponse_table);
fbresult::TableBuilder table(fb_result);
@@ -113,7 +111,7 @@ class TableAPI final : public BaseAPI
{
table.add_fallback_speed_cells(MakeEstimatesTable(fb_result, fallback_speed_cells));
}
response.add_table(table.Finish());
fb_result.Finish(response.Finish());
}