[gnome-commander/gcmd-1-2-8] Simplify and speedup DEBUG_ENABLED()



commit 6174642c1993e78e00ef56465ecea6f33675e2f7
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 92c9a12..ae9ea66 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -53,18 +53,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 912434d..7090398 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -35,7 +35,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]