Merge remote-tracking branch 'linkmauve/big-performances-improvement'
This commit is contained in:
commit
e397f38b47
2 changed files with 5 additions and 2 deletions
|
@ -69,6 +69,7 @@ log = logging.getLogger(__name__)
|
||||||
from poezio.config import config
|
from poezio.config import config
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
|
import functools
|
||||||
import os
|
import os
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
|
@ -403,6 +404,7 @@ def read_tuple(_str):
|
||||||
char = attrs[2] if len(attrs) > 2 else '\0'
|
char = attrs[2] if len(attrs) > 2 else '\0'
|
||||||
return (int(attrs[0]), int(attrs[1])), char
|
return (int(attrs[0]), int(attrs[1])), char
|
||||||
|
|
||||||
|
@functools.lru_cache(maxsize=128)
|
||||||
def to_curses_attr(color_tuple):
|
def to_curses_attr(color_tuple):
|
||||||
"""
|
"""
|
||||||
Takes a color tuple (as defined at the top of this file) and
|
Takes a color tuple (as defined at the top of this file) and
|
||||||
|
|
|
@ -47,10 +47,11 @@ class UserList(Win):
|
||||||
self.cache = new
|
self.cache = new
|
||||||
self.refresh(users)
|
self.refresh(users)
|
||||||
return
|
return
|
||||||
for i in range(len(old)):
|
for a, b in zip(old, new):
|
||||||
if old[i] != new[i]:
|
if a != b:
|
||||||
self.cache = new
|
self.cache = new
|
||||||
self.refresh(users)
|
self.refresh(users)
|
||||||
|
return
|
||||||
|
|
||||||
def refresh(self, users):
|
def refresh(self, users):
|
||||||
log.debug('Refresh: %s', self.__class__.__name__)
|
log.debug('Refresh: %s', self.__class__.__name__)
|
||||||
|
|
Loading…
Reference in a new issue