Code cleanup.

This commit is contained in:
Axel 2020-02-17 11:37:15 +01:00 committed by Marc Garcia Puig
parent 83180fe9a5
commit ae27fe7f78
1 changed files with 89 additions and 93 deletions

View File

@ -42,9 +42,8 @@ namespace parser {
road::RoadId road_id = road_node.attribute("id").as_uint();
const pugi::xml_node signals_node = road_node.child("signals");
for (pugi::xml_node signal_node = signals_node.child("signal");
signal_node;
signal_node = signal_node.next_sibling("signal")) {
if(signals_node){
for (pugi::xml_node signal_node : signals_node.children("signal")) {
const double s_position = signal_node.attribute("s").as_double();
const double t_position = signal_node.attribute("t").as_double();
const road::SignId signal_id = signal_node.attribute("id").value();
@ -107,18 +106,14 @@ namespace parser {
roll);
AddValidity(signal_reference, signal_node, "validity", map_builder);
for (pugi::xml_node dependency_node = signal_node.child("dependency");
dependency_node;
dependency_node = dependency_node.next_sibling("validity")) {
for (pugi::xml_node dependency_node : signal_node.children("dependency")) {
const std::string dependency_id = dependency_node.attribute("id").value();
const std::string dependency_type = dependency_node.attribute("type").value();
log_debug("Added dependency to signal ", signal_id, ":", dependency_id, dependency_type);
map_builder.AddDependencyToSignal(signal_id, dependency_id, dependency_type);
}
}
for (pugi::xml_node signal_reference_node = signals_node.child("signalReference");
signal_reference_node;
signal_reference_node = signal_reference_node.next_sibling("signalReference")) {
for (pugi::xml_node signal_reference_node : signals_node.children("signalReference")) {
const double s_position = signal_reference_node.attribute("s").as_double();
const double t_position = signal_reference_node.attribute("t").as_double();
const road::SignId signal_id = signal_reference_node.attribute("id").value();
@ -141,6 +136,7 @@ namespace parser {
}
}
}
}
} // namespace parser
} // namespace opendrive
} // namespace carla