[gtksourceview] Completion: simplify select_providers()



commit 042af7836bc3996039fa08808c48a00020f7c320
Author: SÃbastien Wilmet <swilmet gnome org>
Date:   Sun Feb 17 15:44:33 2013 +0100

    Completion: simplify select_providers()

 gtksourceview/gtksourcecompletion.c |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 8aa5efd..0b4cc32 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -1459,22 +1459,14 @@ update_typing_offsets (GtkSourceCompletion *completion)
 }
 
 static GList *
-select_providers (GtkSourceCompletion        *completion,
-                  GList                      *providers,
+select_providers (GList                      *providers,
                   GtkSourceCompletionContext *context)
 {
-       /* Select providers based on selection */
        GList *selection = NULL;
 
-       if (providers == NULL)
-       {
-               providers = completion->priv->providers;
-       }
-
-       while (providers)
+       while (providers != NULL)
        {
-               GtkSourceCompletionProvider *provider =
-                       GTK_SOURCE_COMPLETION_PROVIDER (providers->data);
+               GtkSourceCompletionProvider *provider = providers->data;
 
                if (gtk_source_completion_provider_match (provider, context))
                {
@@ -1579,9 +1571,7 @@ auto_completion_prematch (GtkSourceCompletion *completion)
 
        g_signal_emit (completion, signals[POPULATE_CONTEXT], 0, context);
 
-       selection = select_providers (completion,
-                                     completion->priv->interactive_providers,
-                                     context);
+       selection = select_providers (completion->priv->interactive_providers, context);
 
        if (selection == NULL)
        {
@@ -2986,7 +2976,7 @@ gtk_source_completion_show (GtkSourceCompletion        *completion,
        g_signal_emit (completion, signals[POPULATE_CONTEXT], 0, context);
 
        /* From the providers, select the ones that match the context */
-       selected_providers = select_providers (completion, providers, context);
+       selected_providers = select_providers (providers, context);
 
        if (selected_providers == NULL)
        {


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