[gnome-commander] Simplify and speedup DEBUG_ENABLED()



commit fc68fd0c1b2cf002df82ea3cd46d5379c28c81fa
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Mon Dec 13 17:45:57 2010 +0100

    Simplify and speedup DEBUG_ENABLED()

 src/utils.cc |    9 ---------
 src/utils.h  |    8 +++++++-
 2 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/src/utils.cc b/src/utils.cc
index d60f15e..f3bad07 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -54,18 +54,9 @@ extern struct lconv *locale_information;
 #define STRINGS_TO_URIS_CHUNK 1024
 
 static GdkCursor *cursor_busy = NULL;
-extern gchar *debug_flags;
 static gchar *tmp_file_dir = NULL;
 
 
-gboolean DEBUG_ENABLED (gchar flag)
-{
-    if (debug_flags != NULL)
-       return strchr(debug_flags, flag) != 0;
-
-    return FALSE;
-}
-
 /**
  * The already reserved debug flags:
  * --------------------------------
diff --git a/src/utils.h b/src/utils.h
index 5f248c7..e721520 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -37,7 +37,13 @@
 
 #define TRACE(s)  std::cout << __FILE__ "(" << __LINE__ << ") " << __PRETTY_FUNCTION__ << "\t" #s ": `" << (s) << "'" << std::endl
 
-gboolean DEBUG_ENABLED (gchar flag);
+extern gchar *debug_flags;
+
+inline gboolean DEBUG_ENABLED (gchar flag)
+{
+    return debug_flags ? strchr(debug_flags, flag) != 0 : FALSE;
+}
+
 void DEBUG (gchar flag, const gchar *fmt, ...);
 void warn_print (const gchar *fmt, ...);
 



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