[kupfer] kupferstring: Use list comprehension in tofolded
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] kupferstring: Use list comprehension in tofolded
- Date: Mon, 9 Nov 2009 22:01:32 +0000 (UTC)
commit 7d2140d630530cc81c057f765828f5442e93ec24
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Mon Nov 9 22:46:29 2009 +0100
kupferstring: Use list comprehension in tofolded
tofolded is a critical function as it is called for every created
KupferObject. We can speed up the "filter" of the string if we use a
list comprehension instead of a generator expression.
kupfer/kupferstring.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/kupferstring.py b/kupfer/kupferstring.py
index 31a51b2..71e6e72 100644
--- a/kupfer/kupferstring.py
+++ b/kupfer/kupferstring.py
@@ -66,7 +66,7 @@ def tofolded(ustr):
Î?λλαÏ?
"""
srcstr = normalize("NFKD", ustr.translate(folding_table))
- return u"".join(c for c in srcstr if category(c) != 'Mn')
+ return u"".join([c for c in srcstr if category(c) != 'Mn'])
if __name__ == '__main__':
import sys
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]