Skip to content

Commit

Permalink
Got rid of the extra list comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
dlrust committed Feb 7, 2011
1 parent 37e5141 commit ab5d250
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/memcached_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def command(self, cmd):
def key_details(self, sort=True):
' Return a list of tuples containing keys and details '
cmd = 'stats cachedump %s 100'
keys = [j for i in [self._key_regex.findall(self.command(cmd % id))
for id in self.slab_ids()] for j in i] # flatten list
keys = [key for id in self.slab_ids()
for key in self._key_regex.findall(self.command(cmd % id))]
if sort:
return sorted(keys)
else:
Expand Down

0 comments on commit ab5d250

Please sign in to comment.