Filter: Make @uniud linear instead of quadratic.

This commit is contained in:
Valentin Lorentz 2014-05-15 16:45:19 +00:00
parent d6740bfb20
commit 0888104e28

View File

@ -736,16 +736,16 @@ class Filter(callbacks.Plugin):
tmp = self._uniudMap[c] tmp = self._uniudMap[c]
if not len(tmp): if not len(tmp):
tmp = u'\ufffd' tmp = u'\ufffd'
turned.insert(0, tmp) turned.append(tmp)
tlen += 1 tlen += 1
elif c == '\t': elif c == '\t':
tablen = 8 - tlen % 8 tablen = 8 - tlen % 8
turned.insert(0, ' ' * tablen) turned.append(' ' * tablen)
tlen += tablen tlen += tablen
elif ord(c) >= 32: elif ord(c) >= 32:
turned.insert(0, c) turned.append(c)
tlen += 1 tlen += 1
s = '%s \x02 \x02' % ''.join(turned) s = '%s \x02 \x02' % ''.join(reversed(turned))
irc.reply(s) irc.reply(s)
uniud = wrap(uniud, ['text']) uniud = wrap(uniud, ['text'])
Filter = internationalizeDocstring(Filter) Filter = internationalizeDocstring(Filter)