From b9bff8e8cb7b039a8fe34b2e0880e829be8e2be7 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Thu, 5 Dec 2013 13:01:00 +0100 Subject: [PATCH] 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 --- src/crush/CrushWrapper.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 1a9c81e36b0..6ac90ccf657 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