[recipes] Simplify slightly
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Simplify slightly
- Date: Tue, 28 Mar 2017 20:58:54 +0000 (UTC)
commit ac2e7315f5e7ab559a3476743a07226e2731e746
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Mar 28 21:43:30 2017 +0100
Simplify slightly
Make this function as simple as it can be.
src/gr-recipe-store.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/src/gr-recipe-store.c b/src/gr-recipe-store.c
index e62c5ad..96aa028 100644
--- a/src/gr-recipe-store.c
+++ b/src/gr-recipe-store.c
@@ -1191,11 +1191,7 @@ gr_recipe_store_get_all_cuisines (GrRecipeStore *self,
g_hash_table_iter_init (&iter, self->recipes);
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &recipe)) {
- if(! (g_hash_table_contains (cuisines, gr_recipe_get_cuisine (recipe)))) {
- g_hash_table_insert (cuisines,
- (gpointer) (gr_recipe_get_cuisine (recipe)),
- (gpointer) (gr_recipe_get_cuisine (recipe)));
- }
+ g_hash_table_add (cuisines, (gpointer) (gr_recipe_get_cuisine (recipe)));
}
return (char **) g_hash_table_get_keys_as_array (cuisines, length);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]