changeset 29024:90361789d5ac

jabber/jingle: Slightly less repitition.
author Paul Aurich <paul@darkrain42.org>
date Thu, 26 Nov 2009 19:45:21 +0000
parents 0e70cbf43934
children 932661a155b7
files libpurple/protocols/jabber/jingle/session.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle/session.c	Tue Nov 24 17:14:59 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/session.c	Thu Nov 26 19:45:21 2009 +0000
@@ -360,11 +360,15 @@
 JingleSession *
 jingle_session_find_by_sid(JabberStream *js, const gchar *sid)
 {
+	JingleSession *session = NULL;
+
+	if (js->sessions)
+		session = g_hash_table_lookup(js->sessions, sid);
+
 	purple_debug_info("jingle", "find_by_id %s\n", sid);
-	purple_debug_info("jingle", "lookup: %p\n", (js->sessions) ?
-			  g_hash_table_lookup(js->sessions, sid) : NULL);  
-	return (JingleSession *) (js->sessions) ?
-			  g_hash_table_lookup(js->sessions, sid) : NULL;
+	purple_debug_info("jingle", "lookup: %p\n", session);
+
+	return session;
 }
 
 #if GLIB_CHECK_VERSION(2,4,0)