[Devel] [PATCH 6/7] scale(): got rid of awkward continue in loop

Igor Podlesny openvz at poige.ru
Mon May 13 01:39:22 PDT 2013


As a side edit: init in declaration and not needed {} removal
---
 src/vzcfgscale.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/vzcfgscale.c b/src/vzcfgscale.c
index 7fc466a..36db710 100644
--- a/src/vzcfgscale.c
+++ b/src/vzcfgscale.c
@@ -118,14 +118,11 @@ if (param->name != NULL) { \
 	}
 	if (net_k && param->rate != NULL)
 	{
-		struct CList *p;
+		struct CList *p = param->rate;
 
-		for (p = param->rate; p != NULL; p = p->next)
-		{
-			if (p->val2 == NULL)
-				continue;
-			MUL_BOUND(*p->val2, net_k, LONG_MAX);
-		}
+		for (; p != NULL; p = p->next)
+			if (p->val2 != NULL)
+				MUL_BOUND(*p->val2, net_k, LONG_MAX);
 	}
 
 #undef SCALE_PARAM
-- 
1.7.9.5




More information about the Devel mailing list