# HG changeset patch # User Mark Doliner # Date 1175581822 0 # Node ID 0315b014741b0fdcbfbf5e9c87e614e96751343e # Parent 6dc5dc83a61b70649bf96c677ff38c52ed83322f 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. diff -r 6dc5dc83a61b -r 0315b014741b pidgin/gtkdebug.c --- 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 =