From: Daniel Carl Date: Sat, 6 Apr 2013 18:53:54 +0000 (+0200) Subject: Removed no more required function to concatenate list. X-Git-Url: https://git.owens.tech/wrapped.html/wrapped.html/git?a=commitdiff_plain;h=b3eeefb4cf6398d8de659a9cb848ebad99ff343d;p=vimb.git Removed no more required function to concatenate list. --- diff --git a/src/completion.c b/src/completion.c index 7d49641..dd38818 100644 --- a/src/completion.c +++ b/src/completion.c @@ -33,7 +33,6 @@ typedef struct { static GList *filter_list(GList *target, GList *source, Comp_Func func, const char *input); static GList *init_completion(GList *target, GList *source, const char *prefix); -static GList *prepend_bookmark_completion(GList *target, GList *source); static GList *update(GList *completion, GList *active, gboolean back); static void show(gboolean back); static void set_entry_text(Completion *completion); @@ -86,7 +85,7 @@ gboolean completion_complete(gboolean back) source = history_get_all(HISTORY_URL); tmp = filter_list(tmp, source, (Comp_Func)util_strcasestr, &input[6]), /* prepend the bookmark items */ - tmp = prepend_bookmark_completion(tmp, bookmark_get_by_tags(&input[6])); + tmp = g_list_concat(bookmark_get_by_tags(&input[6]), tmp); vb.comps.completions = init_completion( vb.comps.completions, tmp, @@ -98,7 +97,7 @@ gboolean completion_complete(gboolean back) source = history_get_all(HISTORY_URL); tmp = filter_list(tmp, source, (Comp_Func)util_strcasestr, &input[9]), /* prepend the bookmark items */ - tmp = prepend_bookmark_completion(tmp, bookmark_get_by_tags(&input[9])); + tmp = g_list_concat(bookmark_get_by_tags(&input[9]), tmp); vb.comps.completions = init_completion( vb.comps.completions, tmp, @@ -171,15 +170,6 @@ static GList *init_completion(GList *target, GList *source, const char *prefix) return target; } -static GList *prepend_bookmark_completion(GList *target, GList *source) -{ - for (GList *l = source; l; l = l->next) { - target = g_list_prepend(target, l->data); - } - - return target; -} - static GList *update(GList *completion, GList *active, gboolean back) { GList *old, *new;