Clean up a list-comp (also fixes race condition)

This commit is contained in:
Jeff Forcier 2014-02-10 18:21:47 -08:00
parent 1d87a0ceb9
commit 675e30986e
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class SFTPFile (BufferedFile):
pass pass
def _data_in_prefetch_requests(self, offset, size): def _data_in_prefetch_requests(self, offset, size):
k = [self._prefetch_extents[i] for i in self._prefetch_extents if self._prefetch_extents[i][0] <= offset] k = [x for x in self._prefetch_extents.values() if x[0] <= offset]
if len(k) == 0: if len(k) == 0:
return False return False
k.sort(lambda x, y: cmp(x[0], y[0])) k.sort(lambda x, y: cmp(x[0], y[0]))