[gnome-builder/wip/libide] libide: add extra assertions to verify state



commit fe883f9c0b212577246bf43a6cf90dda9f4e7b59
Author: Christian Hergert <christian hergert me>
Date:   Tue Feb 17 13:05:51 2015 -0800

    libide: add extra assertions to verify state

 libide/git/ide-git-search-provider.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/libide/git/ide-git-search-provider.c b/libide/git/ide-git-search-provider.c
index 8778b31..634f37c 100644
--- a/libide/git/ide-git-search-provider.c
+++ b/libide/git/ide-git-search-provider.c
@@ -142,18 +142,20 @@ populate_get_index_cb (GObject      *object,
   g_autoptr(IdeGitSearchIndex) index = NULL;
   GError *error = NULL;
 
+  g_assert (state);
+  g_assert (IDE_IS_SEARCH_CONTEXT (state->context));
+  g_assert (IDE_IS_SEARCH_PROVIDER (self));
+  g_assert (state->search_terms);
+
   index = ide_git_search_provider_get_index_finish (self, result, &error);
 
   if (index)
-    {
-      ide_git_search_index_populate (index,
-                                     IDE_SEARCH_PROVIDER (self),
-                                     state->context,
-                                     state->max_results,
-                                     state->search_terms);
-    }
+    ide_git_search_index_populate (index,
+                                   IDE_SEARCH_PROVIDER (self),
+                                   state->context,
+                                   state->max_results,
+                                   state->search_terms);
 
-cleanup:
   ide_search_context_provider_completed (state->context,
                                          IDE_SEARCH_PROVIDER (self));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]