[gspell/wip/unit-tests: 1/2] inline-checker-text-buffer: remove debug code



commit b1dd41d5965d0c66a253e03cbe0e516515e4e2b4
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Feb 4 14:00:29 2016 +0100

    inline-checker-text-buffer: remove debug code
    
    It gets in the way, and anyway when debugging something we are usually
    interested by different information each time.
    
    To be sure that the code is correct, I prefer code clarity, to make it
    easy to read and understand. By adding lots of debug code, we make the
    code less easy to read, and thus there can be more bugs, which is
    exactly the thing that we want to avoid…

 gspell/gspell-inline-checker-text-buffer.c |   17 -----------------
 1 files changed, 0 insertions(+), 17 deletions(-)
---
diff --git a/gspell/gspell-inline-checker-text-buffer.c b/gspell/gspell-inline-checker-text-buffer.c
index 93bc4ac..822c1ea 100644
--- a/gspell/gspell-inline-checker-text-buffer.c
+++ b/gspell/gspell-inline-checker-text-buffer.c
@@ -57,8 +57,6 @@ enum
        PROP_BUFFER,
 };
 
-#define ENABLE_DEBUG 0
-
 #define INLINE_CHECKER_TEXT_BUFFER_KEY "GspellInlineCheckerTextBufferID"
 #define SUGGESTION_KEY                 "GspellInlineSuggestionID"
 
@@ -311,32 +309,17 @@ static void
 check_visible_region (GspellInlineCheckerTextBuffer *spell)
 {
        GSList *l;
-#if ENABLE_DEBUG
-       GTimer *timer;
-#endif
 
        if (spell->scan_region == NULL)
        {
                return;
        }
 
-#if ENABLE_DEBUG
-       timer = g_timer_new ();
-#endif
-
        for (l = spell->views; l != NULL; l = l->next)
        {
                GtkTextView *view = GTK_TEXT_VIEW (l->data);
                check_visible_region_in_view (spell, view);
        }
-
-#if ENABLE_DEBUG
-       g_print ("%s() executed in %lf seconds\n",
-                G_STRFUNC,
-                g_timer_elapsed (timer, NULL));
-
-       g_timer_destroy (timer);
-#endif
 }
 
 static gboolean


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