diff options
author | Max Kellermann <max@duempel.org> | 2012-02-11 10:34:21 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-02-11 12:37:24 +0100 |
commit | 767ade02f4af8cdb6b7de293d0bd433bc7fd24cf (patch) | |
tree | 657ef4bf4fc49524007cb6e26d214edb04585ff3 /src/tag_ape.c | |
parent | 6e05071a47cd2f496f49d08823ace6fdcb1f79cd (diff) |
tag_table: convert to a struct
The struct is smaller because it is sparse. Its traversal is also
more efficient.
Diffstat (limited to 'src/tag_ape.c')
-rw-r--r-- | src/tag_ape.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tag_ape.c b/src/tag_ape.c index 1978ea39..5a30531c 100644 --- a/src/tag_ape.c +++ b/src/tag_ape.c @@ -23,15 +23,16 @@ #include "tag_table.h" #include "ape.h" -static const char *const ape_tag_names[TAG_NUM_OF_ITEM_TYPES] = { - [TAG_ALBUM_ARTIST] = "album artist", - [TAG_DATE] = "year", +static const struct tag_table ape_tags[] = { + { "album artist", TAG_ALBUM_ARTIST }, + { "year", TAG_DATE }, + { NULL, TAG_NUM_OF_ITEM_TYPES } }; static enum tag_type tag_ape_name_parse(const char *name) { - enum tag_type type = tag_table_lookup(ape_tag_names, name); + enum tag_type type = tag_table_lookup_i(ape_tags, name); if (type == TAG_NUM_OF_ITEM_TYPES) type = tag_name_parse_i(name); |