changeset 15986:0315b014741b

Check if debug_win is != NULL before checking the preference. This should avoid a hash table lookup when debugging is turned off. I think debug_win will ALWAYS be non-null when debugging is on and ALWAYS be null when debugging is off, but I'm not positive and I didn't want to break anything, so I left both checks in there.
author Mark Doliner <mark@kingant.net>
date Tue, 03 Apr 2007 06:30:22 +0000
parents 6dc5dc83a61b
children 7adb832667fd
files pidgin/gtkdebug.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkdebug.c	Tue Apr 03 06:26:20 2007 +0000
+++ b/pidgin/gtkdebug.c	Tue Apr 03 06:30:22 2007 +0000
@@ -1046,8 +1046,8 @@
 	gchar *ts_s;
 	gchar *esc_s, *cat_s, *tmp, *s;
 
-	if (!purple_prefs_get_bool("/purple/gtk/debug/enabled") ||
-	    (debug_win == NULL))
+	if (debug_win == NULL ||
+		!purple_prefs_get_bool("/purple/gtk/debug/enabled"))
 	{
 		return;
 	}
@@ -1107,8 +1107,8 @@
 static gboolean
 pidgin_debug_is_enabled(PurpleDebugLevel level, const char *category)
 {
-	return (purple_prefs_get_bool("/purple/gtk/debug/enabled") &&
-			debug_win != NULL);
+	return (debug_win != NULL &&
+			purple_prefs_get_bool("/purple/gtk/debug/enabled"));
 }
 
 static PurpleDebugUiOps ops =