diff options
author | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2014-07-17 20:22:10 +0000 |
---|---|---|
committer | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2014-07-17 20:22:10 +0000 |
commit | 186780c43f0b96852cc9b068e8eb131955e9b506 (patch) | |
tree | e605094f16072571ec15a027d63e75c63371829f /navit/maptool | |
parent | c2fb791eb151e0d1bca32ae9b23cade2a21edfd9 (diff) | |
download | navit-186780c43f0b96852cc9b068e8eb131955e9b506.tar.gz |
Refactor:maptool:Some comments about relation processing.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5820 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/maptool')
-rw-r--r-- | navit/maptool/osm_relations.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/navit/maptool/osm_relations.c b/navit/maptool/osm_relations.c index 713137c74..1ad04a281 100644 --- a/navit/maptool/osm_relations.c +++ b/navit/maptool/osm_relations.c @@ -21,8 +21,11 @@ #include "maptool.h" #include "attr.h" +/** Information about all members of a relation type and how to process them. */ struct relations { + /** Hashes for nodes, ways and relations which are members. */ GHashTable *member_hash[3]; + /** Default entries for processing items which are not a member of any relation. */ GList *default_members; }; @@ -99,6 +102,7 @@ relations_add_relation_member_entry(struct relations *rel, struct relations_func { struct relations_member *memb=relations_member_new(func, relation_priv, member_priv, id); GHashTable *member_hash=rel->member_hash[type-1]; + // The real key is the OSM ID, but we recycle "memb" as key to avoid a second allocating for the key. g_hash_table_insert(member_hash, memb, g_list_append(g_hash_table_lookup(member_hash, memb), memb)); } |