summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2016-06-05 17:24:27 +0200
committerLemonBoy <thatlemon@gmail.com>2016-06-05 17:24:27 +0200
commit0060f682c213dc25901f4c0ab01a01176e14da9e (patch)
treeb23ef3ec549ae6d0c935549a94578934fad0379f /src/fe-common
parent2e8744319d5e5e47799ec20b2f737c437e8c6398 (diff)
downloadirssi-0060f682c213dc25901f4c0ab01a01176e14da9e.zip
Factor out some redundant code and remove hashtable_get_keys
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/fe-exec.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/fe-common/core/fe-exec.c b/src/fe-common/core/fe-exec.c
index b5f289ce..36990866 100644
--- a/src/fe-common/core/fe-exec.c
+++ b/src/fe-common/core/fe-exec.c
@@ -237,22 +237,13 @@ static int signal_name_to_id(const char *name)
static int cmd_options_get_signal(const char *cmd,
GHashTable *optlist)
{
- GSList *list, *tmp, *next;
+ GList *list;
char *signame;
int signum;
/* get all the options, then remove the known ones. there should
be only one left - the signal */
- 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);
if (list == NULL)
return -1;
@@ -272,7 +263,7 @@ static int cmd_options_get_signal(const char *cmd,
return -2;
}
- g_slist_free(list);
+ g_list_free(list);
return signum;
}