summaryrefslogtreecommitdiff
path: root/alot/ui.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-12-14 14:52:01 -0800
committerDylan Baker <dylan@pnwbakers.com>2016-12-21 17:09:25 -0800
commit68f64472f69a509b4245a0a2ca491a1256100ab9 (patch)
tree583f28be3c6ec629354460cf16f87acc06fd0d5d /alot/ui.py
parent5745e2291fb4d3c81076256d8bc563d50da16da5 (diff)
Replace map() and filter() with comprehensions
This had the advantage of being more readable to people without a functional programming background, and it avoids the need to use lambdas which are both slow and have many corners in python. In a few cases it also allows us to use a generator expression instead of a materialized list, which save some memory.
Diffstat (limited to 'alot/ui.py')
-rw-r--r--alot/ui.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/alot/ui.py b/alot/ui.py
index 811f2150..a56efe4b 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -446,7 +446,7 @@ class UI(object):
:type t: alot.buffers.Buffer
:rtype: list
"""
- return filter(lambda x: isinstance(x, t), self.buffers)
+ return [x for x in self.buffers if isinstance(x, t)]
def clear_notify(self, messages):
"""