summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-07-06 04:23:31 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-07-06 04:32:23 +0100
commit69b4480e9e6ff578b880b7d8089616bc68e60f71 (patch)
tree0f0acf0e0655d7db27e73467c5b7f073be30b5f6
parenta47e18e873521627abd326bec0c26e05f5775e64 (diff)
downloadpoezio-69b4480e9e6ff578b880b7d8089616bc68e60f71.tar.gz
poezio-69b4480e9e6ff578b880b7d8089616bc68e60f71.tar.bz2
poezio-69b4480e9e6ff578b880b7d8089616bc68e60f71.tar.xz
poezio-69b4480e9e6ff578b880b7d8089616bc68e60f71.zip
Make UserList.refresh_if_possible not hyper dumb.
This function was actually calling refresh for every single item that was different from the cached version.
-rw-r--r--poezio/windows/muc.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/poezio/windows/muc.py b/poezio/windows/muc.py
index 897b9f81..ee57ab6e 100644
--- a/poezio/windows/muc.py
+++ b/poezio/windows/muc.py
@@ -47,10 +47,11 @@ class UserList(Win):
self.cache = new
self.refresh(users)
return
- for i in range(len(old)):
- if old[i] != new[i]:
+ for a, b in zip(old, new):
+ if a != b:
self.cache = new
self.refresh(users)
+ return
def refresh(self, users):
log.debug('Refresh: %s', self.__class__.__name__)