[gnome-builder] langserv-client: simplify get_diagnostics_finish()



commit 9319b0d0fe6fb440d56595bd2f08243649b67c73
Author: Christian Hergert <chergert redhat com>
Date:   Sun Oct 30 16:04:01 2016 -0700

    langserv-client: simplify get_diagnostics_finish()
    
    This will always return an empty diagnostics, so just do that from the
    task callback instead of making finish() more complicated.

 libide/langserv/ide-langserv-client.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/libide/langserv/ide-langserv-client.c b/libide/langserv/ide-langserv-client.c
index e04c6d6..03dea49 100644
--- a/libide/langserv/ide-langserv-client.c
+++ b/libide/langserv/ide-langserv-client.c
@@ -1188,7 +1188,9 @@ ide_langserv_client_get_diagnostics_async (IdeLangservClient   *self,
                            ide_diagnostics_ref (diagnostics),
                            (GDestroyNotify)ide_diagnostics_unref);
   else
-    g_task_return_pointer (task, NULL, NULL);
+    g_task_return_pointer (task,
+                           ide_diagnostics_new (NULL),
+                           (GDestroyNotify)ide_diagnostics_unref);
 }
 
 /**
@@ -1217,10 +1219,7 @@ ide_langserv_client_get_diagnostics_finish (IdeLangservClient  *self,
   g_return_val_if_fail (G_IS_TASK (result), FALSE);
 
   local_diagnostics = g_task_propagate_pointer (G_TASK (result), &local_error);
-  ret = local_error == NULL;
-
-  if (ret == TRUE && local_diagnostics == NULL)
-    local_diagnostics = ide_diagnostics_new (NULL);
+  ret = local_diagnostics != NULL;
 
   if (local_diagnostics != NULL && diagnostics != NULL)
     *diagnostics = g_steal_pointer (&local_diagnostics);


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