From: Loic Dachary Date: Thu, 5 Dec 2013 12:01:00 +0000 (+0100) Subject: crush: remove redundant test in insert_item X-Git-Tag: v0.74~30^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b9bff8e8cb7b039a8fe34b2e0880e829be8e2be7;p=ceph.git crush: remove redundant test in insert_item A year after the last modification of test to check if an item was added twice to the same bucket, the subtree_contains test was added a few lines above it, making it redundant. Signed-off-by: Loic Dachary --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 1a9c81e36b02..6ac90ccf6575 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -410,14 +410,6 @@ int CrushWrapper::insert_item(CephContext *cct, int item, float weight, string n return -EINVAL; } - - // make sure the item doesn't already exist in this bucket - for (unsigned j=0; jsize; j++) - if (b->items[j] == cur) { - ldout(cct, 1) << "insert_item " << cur << " already exists in bucket " << b->id << dendl; - return -EEXIST; - } - // are we forming a loop? if (subtree_contains(cur, b->id)) { ldout(cct, 1) << "insert_item " << cur << " already contains " << b->id