Change in ...libosmocore[master]: vty: command.c: Get rid of big indentation block

pespin gerrit-no-reply at lists.osmocom.org
Wed Jun 12 16:41:02 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/14430


Change subject: vty: command.c: Get rid of big indentation block
......................................................................

vty: command.c: Get rid of big indentation block

This block will become bigger in forthcoming commits.

Change-Id: Ibc1494014b1e77ce10950f7268a44d2d2091a6f2
---
M src/vty/command.c
1 file changed, 26 insertions(+), 24 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/14430/1

diff --git a/src/vty/command.c b/src/vty/command.c
index 4189c7c..54dbfe1 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2294,23 +2294,24 @@
 	argc = 0;
 
 	for (i = 0; i < vector_active(vline); i++) {
-		if (varflag)
+		if (varflag) {
 			argv[argc++] = vector_slot(vline, i);
-		else {
-			vector descvec =
-			    vector_slot(matched_element->strvec, i);
+			continue;
+		}
 
-			if (vector_active(descvec) == 1) {
-				struct desc *desc = vector_slot(descvec, 0);
+		vector descvec = vector_slot(matched_element->strvec, i);
 
-				if (CMD_VARARG(desc->cmd))
-					varflag = 1;
+		if (vector_active(descvec) == 1) {
+			struct desc *desc = vector_slot(descvec, 0);
 
-				if (varflag || CMD_VARIABLE(desc->cmd)
-				    || CMD_OPTION(desc->cmd))
-					argv[argc++] = vector_slot(vline, i);
-			} else
+			if (CMD_VARARG(desc->cmd))
+				varflag = 1;
+
+			if (varflag || CMD_VARIABLE(desc->cmd)
+			    || CMD_OPTION(desc->cmd))
 				argv[argc++] = vector_slot(vline, i);
+		} else {
+			argv[argc++] = vector_slot(vline, i);
 		}
 
 		if (argc >= CMD_ARGC_MAX)
@@ -2439,23 +2440,24 @@
 	argc = 0;
 
 	for (i = 0; i < vector_active(vline); i++) {
-		if (varflag)
+		if (varflag) {
 			argv[argc++] = vector_slot(vline, i);
-		else {
-			vector descvec =
-			    vector_slot(matched_element->strvec, i);
+			continue;
+		}
 
-			if (vector_active(descvec) == 1) {
-				struct desc *desc = vector_slot(descvec, 0);
+		vector descvec =vector_slot(matched_element->strvec, i);
 
-				if (CMD_VARARG(desc->cmd))
-					varflag = 1;
+		if (vector_active(descvec) == 1) {
+			struct desc *desc = vector_slot(descvec, 0);
 
-				if (varflag || CMD_VARIABLE(desc->cmd)
-				    || CMD_OPTION(desc->cmd))
-					argv[argc++] = vector_slot(vline, i);
-			} else
+			if (CMD_VARARG(desc->cmd))
+				varflag = 1;
+
+			if (varflag || CMD_VARIABLE(desc->cmd)
+			    || CMD_OPTION(desc->cmd))
 				argv[argc++] = vector_slot(vline, i);
+		} else {
+			argv[argc++] = vector_slot(vline, i);
 		}
 
 		if (argc >= CMD_ARGC_MAX)

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14430
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibc1494014b1e77ce10950f7268a44d2d2091a6f2
Gerrit-Change-Number: 14430
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190612/ad542f46/attachment.html>


More information about the gerrit-log mailing list