diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2016-12-14 14:52:01 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2016-12-21 17:09:25 -0800 |
commit | 68f64472f69a509b4245a0a2ca491a1256100ab9 (patch) | |
tree | 583f28be3c6ec629354460cf16f87acc06fd0d5d /alot/ui.py | |
parent | 5745e2291fb4d3c81076256d8bc563d50da16da5 (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.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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): """ |