*/
lua_pushstring(L,"symmetrical");
lua_gettable(L,-2);
- if (lua_isstring(L, -1)) {
- const char* value = lua_tostring(L, -1);
- if (strcmp("YES", value) == 0)
- route.symmetrical = true;
- else
- route.symmetrical = false;
- }
- else {
- route.symmetrical = true;
- }
+ route.symmetrical = (not lua_isstring(L, -1) || strcasecmp("YES", lua_tostring(L, -1)) == 0);
lua_pop(L,1);
route.gw_src = nullptr;
lua_pushstring(L,"symmetrical");
lua_gettable(L,-2);
- if (lua_isstring(L, -1)) {
- const char* value = lua_tostring(L, -1);
- if (strcmp("YES", value) == 0)
- ASroute.symmetrical = true;
- else
- ASroute.symmetrical = false;
- }
- else {
- ASroute.symmetrical = true;
- }
+ ASroute.symmetrical = (not lua_isstring(L, -1) || strcasecmp("YES", lua_tostring(L, -1)) == 0);
lua_pop(L,1);
sg_platf_new_route(&ASroute);
route.dst = sg_netpoint_by_name_or_null(A_surfxml_route_dst); // tested to not be nullptr in start tag
route.gw_src = nullptr;
route.gw_dst = nullptr;
- route.symmetrical = (A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES);
+ route.symmetrical = (A_surfxml_route_symmetrical == AU_surfxml_route_symmetrical ||
+ A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES ||
+ A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_yes);
route.link_list.swap(parsed_link_list);
ASroute.link_list.swap(parsed_link_list);
- switch (A_surfxml_zoneRoute_symmetrical) {
- case AU_surfxml_zoneRoute_symmetrical:
- case A_surfxml_zoneRoute_symmetrical_YES:
- ASroute.symmetrical = true;
- break;
- case A_surfxml_zoneRoute_symmetrical_NO:
- ASroute.symmetrical = false;
- break;
- default:
- THROW_IMPOSSIBLE;
- }
+ ASroute.symmetrical = (A_surfxml_zoneRoute_symmetrical == AU_surfxml_zoneRoute_symmetrical ||
+ A_surfxml_zoneRoute_symmetrical == A_surfxml_zoneRoute_symmetrical_YES ||
+ A_surfxml_zoneRoute_symmetrical == A_surfxml_zoneRoute_symmetrical_yes);
sg_platf_new_route(&ASroute);
}