[devhelp] SearchContext: turn a g_return into a g_assert
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] SearchContext: turn a g_return into a g_assert
- Date: Sun, 21 Jan 2018 19:38:58 +0000 (UTC)
commit 04c2ec36e69da143e7dd8e335e6e0f9e4bfc3e32
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Jan 21 20:34:58 2018 +0100
SearchContext: turn a g_return into a g_assert
In the for loop in create_keywords_data() we are sure that
cur_keyword != NULL, it's the loop condition.
src/dh-search-context.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/dh-search-context.c b/src/dh-search-context.c
index 7a96bff..a8b31bb 100644
--- a/src/dh-search-context.c
+++ b/src/dh-search-context.c
@@ -225,7 +225,7 @@ keyword_data_new (const gchar *keyword,
{
KeywordData *data;
- g_return_val_if_fail (keyword != NULL, NULL);
+ g_assert (keyword != NULL);
data = g_new0 (KeywordData, 1);
@@ -285,8 +285,7 @@ create_keywords_data (DhSearchContext *search)
KeywordData *data;
data = keyword_data_new (cur_keyword, keyword_num == 0);
- if (data != NULL)
- search->keywords_data = g_slist_prepend (search->keywords_data, data);
+ search->keywords_data = g_slist_prepend (search->keywords_data, data);
}
search->keywords_data = g_slist_reverse (search->keywords_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]