From aa6bd2c0abedfd791929fad2f24795b4069e7035 Mon Sep 17 00:00:00 2001 From: YummyBian Date: Tue, 22 Apr 2014 23:52:28 +0800 Subject: [PATCH] Fix redundant add operation of set in ring You don't need to add dev_id into seen_ids again when it has already existed in seen_ids. Fixes Bug #1311190 Change-Id: If0766de8dc5e2a59a648cae39c789c91131805d2 --- swift/common/ring/ring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/common/ring/ring.py b/swift/common/ring/ring.py index a1f9024bc4..61482094dc 100644 --- a/swift/common/ring/ring.py +++ b/swift/common/ring/ring.py @@ -239,7 +239,7 @@ class Ring(object): dev_id = r2p2d[part] if dev_id not in seen_ids: part_nodes.append(self.devs[dev_id]) - seen_ids.add(dev_id) + seen_ids.add(dev_id) return part_nodes def get_part(self, account, container=None, obj=None):