diff options
author | LemonBoy <thatlemon@gmail.com> | 2016-06-05 17:24:27 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2016-06-05 17:24:27 +0200 |
commit | 0060f682c213dc25901f4c0ab01a01176e14da9e (patch) | |
tree | b23ef3ec549ae6d0c935549a94578934fad0379f /src/fe-text | |
parent | 2e8744319d5e5e47799ec20b2f737c437e8c6398 (diff) | |
download | irssi-0060f682c213dc25901f4c0ab01a01176e14da9e.zip |
Factor out some redundant code and remove hashtable_get_keys
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/lastlog.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/fe-text/lastlog.c b/src/fe-text/lastlog.c index 166d2847..c0b1dde8 100644 --- a/src/fe-text/lastlog.c +++ b/src/fe-text/lastlog.c @@ -39,21 +39,10 @@ Returns -1 if unknown option was given. */ int cmd_options_get_level(const char *cmd, GHashTable *optlist) { - GSList *list, *tmp, *next; + GList *list; int level, retlevel; - /* get all the options, then remove the known ones. there should - be only one left - the server tag. */ - list = hashtable_get_keys(optlist); - if (cmd != NULL) { - for (tmp = list; tmp != NULL; tmp = next) { - char *option = tmp->data; - next = tmp->next; - - if (command_have_option(cmd, option)) - list = g_slist_remove(list, option); - } - } + list = optlist_remove_known(cmd, optlist); retlevel = 0; while (list != NULL) { @@ -68,7 +57,7 @@ int cmd_options_get_level(const char *cmd, GHashTable *optlist) } retlevel |= level; - list = g_slist_remove(list, list->data); + list = g_list_remove(list, list->data); } return retlevel; |