Use an existing local var rather than doing alookup

This should make ``Ring.get_more_nodes`` microscopically faster.

Change-Id: Ibf0988fe0630ad94ac0c04040766d89ef86d1488
This commit is contained in:
Alex Gaynor 2013-09-13 09:50:14 -07:00
parent cb114e5ecf
commit 5b0788d37d

View File

@ -313,7 +313,7 @@ class Ring(object):
dev_id = part2dev_id[handoff_part]
dev = self._devs[dev_id]
region = dev['region']
zone = (dev['region'], dev['zone'])
zone = (region, dev['zone'])
if dev_id not in used and region not in same_regions:
yield dev
used.add(dev_id)