[sheepdog] [PATCH] Sheep: Merge two "for loops" into one

Ziye Yang ziye.yang at intel.com
Thu Jun 25 05:40:38 CEST 2015


This patch is just used to merge the two "for loops" into one

Signed-off-by: Ziye Yang <ziye.yang at intel.com>
---
 sheep/recovery.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 12a293a..56328dc 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -444,10 +444,10 @@ static void *rebuild_erasure_object(uint64_t oid, uint8_t idx,
 	uint8_t *bufs[ed];
 	int idxs[ed];
 
-	for (i = 0; i < ed; i++)
+	for (i = 0; i < ed; i++) {
 		bufs[i] = NULL;
-	for (i = 0; i < ed; i++)
 		idxs[i] = 0;
+	}
 
 	/* Prepare replica */
 	for (i = 0, j = 0; i < edp && j < ed; i++) {



More information about the sheepdog mailing list