diff options
author | mvglasow <michael -at- vonglasow.com> | 2019-01-07 18:36:38 +0100 |
---|---|---|
committer | mvglasow <michael -at- vonglasow.com> | 2019-01-07 18:36:38 +0100 |
commit | 8dce7363b9f9840dc8660696294e0c102f4ee32b (patch) | |
tree | 39cfa3ca795e8da6be1a6c3e85cef8ffe578df7c /navit/traffic.c | |
parent | 9ec874a084356973cfd760f2d9cf1875b1f79a53 (diff) | |
download | navit-8dce7363b9f9840dc8660696294e0c102f4ee32b.tar.gz |
Refactor:traffic:Internal variable for point attribute matching
Signed-off-by: mvglasow <michael -at- vonglasow.com>
Diffstat (limited to 'navit/traffic.c')
-rw-r--r-- | navit/traffic.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/navit/traffic.c b/navit/traffic.c index 084700519..ffd8cc788 100644 --- a/navit/traffic.c +++ b/navit/traffic.c @@ -1342,6 +1342,12 @@ static int traffic_point_match_attributes(struct traffic_point * this_, struct i static int traffic_point_match_segment_attributes(struct traffic_point * this_, struct route_graph_point *p, struct route_graph_point * start, int match_start) { + /* + * Whether we want a match for the route segment starting at p (leading away from it) or the route segment ending + * at p (leading towards it). + */ + int want_start_match = match_start; + /* Iterator for route graph points */ struct route_graph_point *p_iter = start; @@ -1455,7 +1461,7 @@ static int traffic_point_match_segment_attributes(struct traffic_point * this_, return 0; } } else { - if ((match_start && !has_start_match) || (!match_start && !has_end_match)) { + if ((want_start_match && !has_start_match) || (!want_start_match && !has_end_match)) { /* no match in requested category */ dbg(lvl_debug, "p=%p: no match in requested category, score 0", p); return 0; |