[gnome-builder] clang-completion: check enabled setting upfront



commit 627c4329e726137f2cc063cc1a558d47080e12c5
Author: Christian Hergert <chergert redhat com>
Date:   Mon Nov 7 12:57:39 2016 -0800

    clang-completion: check enabled setting upfront
    
    We can avoid some work by checking this immediately, and it should be
    cached by GSettings for us.

 plugins/clang/ide-clang-completion-provider.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/clang/ide-clang-completion-provider.c b/plugins/clang/ide-clang-completion-provider.c
index 46a401d..1a8c568 100644
--- a/plugins/clang/ide-clang-completion-provider.c
+++ b/plugins/clang/ide-clang-completion-provider.c
@@ -138,6 +138,9 @@ ide_clang_completion_provider_match (GtkSourceCompletionProvider *provider,
   g_return_val_if_fail (IDE_IS_CLANG_COMPLETION_PROVIDER (self), FALSE);
   g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_CONTEXT (context), FALSE);
 
+  if (!g_settings_get_boolean (self->settings, "clang-autocompletion"))
+    return FALSE;
+
   if (!gtk_source_completion_context_get_iter (context, &iter))
     return FALSE;
 
@@ -168,9 +171,6 @@ ide_clang_completion_provider_match (GtkSourceCompletionProvider *provider,
         return FALSE;
     }
 
-  if (!g_settings_get_boolean (self->settings, "clang-autocompletion"))
-    return FALSE;
-
   return TRUE;
 }
 


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