From 23931489085391a97ab8b358e9da1c5c8cfb4e94 Mon Sep 17 00:00:00 2001 From: Jay Farrimond Date: Fri, 6 Jul 2012 13:50:15 -0700 Subject: dereference iq stanza only once for roster processing --- sleekxmpp/clientxmpp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py index 7f606de7..03070b06 100644 --- a/sleekxmpp/clientxmpp.py +++ b/sleekxmpp/clientxmpp.py @@ -270,8 +270,9 @@ class ClientXMPP(BaseXMPP): roster = self.client_roster if iq['roster']['ver']: roster.version = iq['roster']['ver'] - for jid in iq['roster']['items']: - item = iq['roster']['items'][jid] + items = iq['roster']['items'] + for jid in items: + item = items[jid] roster[jid]['name'] = item['name'] roster[jid]['groups'] = item['groups'] roster[jid]['from'] = item['subscription'] in ['from', 'both'] -- cgit v1.2.3