[gnome-builder] gettext: style cleanup



commit ff9449a940d77d9666a82828c122930fe3166074
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 13 14:41:54 2016 +0300

    gettext: style cleanup
    
    Cleanup gtask usage and precondition checks.

 plugins/gettext/ide-gettext-diagnostic-provider.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plugins/gettext/ide-gettext-diagnostic-provider.c 
b/plugins/gettext/ide-gettext-diagnostic-provider.c
index 7697f54..2acf1e9 100644
--- a/plugins/gettext/ide-gettext-diagnostic-provider.c
+++ b/plugins/gettext/ide-gettext-diagnostic-provider.c
@@ -178,14 +178,18 @@ get_diagnostics_cb (GObject      *source_object,
 {
   EggTaskCache *cache = EGG_TASK_CACHE (source_object);
   g_autoptr(GTask) task = user_data;
-  IdeGettextDiagnostics *diags;
+  g_autoptr(IdeGettextDiagnostics) diags = NULL;
   GError *error = NULL;
 
+  g_assert (EGG_IS_TASK_CACHE (cache));
+  g_assert (G_IS_TASK (task));
+
   diags = egg_task_cache_get_finish (cache, res, &error);
-  if (!diags)
+
+  if (diags == NULL)
     g_task_return_error (task, error);
   else
-    g_task_return_pointer (task, diags, g_object_unref);
+    g_task_return_pointer (task, g_steal_pointer (&diags), g_object_unref);
 }
 
 static void


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