mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-20 11:38:52 +00:00
replace calls to filter with list comprehension
This commit is contained in:
parent
3e571fc4cf
commit
f0cddcb8da
@ -132,9 +132,7 @@ class MagicFolder(service.MultiService):
|
||||
upload_readonly_dircap = self._upload_dirnode.get_readonly_uri()
|
||||
collective_dirmap_d = self._collective_dirnode.list()
|
||||
def do_filter(result):
|
||||
def not_mine(x):
|
||||
return result[x][0].get_readonly_uri() != upload_readonly_dircap
|
||||
others = filter(not_mine, result.keys())
|
||||
others = [x for x in result.keys() if result[x][0].get_readonly_uri() != upload_readonly_dircap]
|
||||
return result, others
|
||||
collective_dirmap_d.addCallback(do_filter)
|
||||
def scan_collective(result):
|
||||
@ -180,9 +178,7 @@ class MagicFolder(service.MultiService):
|
||||
upload_readonly_dircap = self._upload_dirnode.get_readonly_uri()
|
||||
collective_dirmap_d = self._collective_dirnode.list()
|
||||
def do_filter(result):
|
||||
def not_mine(x):
|
||||
return result[x][0].get_readonly_uri() != upload_readonly_dircap
|
||||
others = filter(not_mine, result.keys())
|
||||
others = [x for x in result.keys() if result[x][0].get_readonly_uri() != upload_readonly_dircap]
|
||||
return result, others
|
||||
collective_dirmap_d.addCallback(do_filter)
|
||||
def scan_collective(result):
|
||||
|
Loading…
Reference in New Issue
Block a user