Change in libosmocore[master]: vty/command: cosmetic: simplify conditions in in config_list_cmd

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Aug 15 07:46:53 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/19573 )

Change subject: vty/command: cosmetic: simplify conditions in in config_list_cmd
......................................................................

vty/command: cosmetic: simplify conditions in in config_list_cmd

Change-Id: Id1c082d102b7156dafb9c5d9197dcdc4d26bff63
---
M src/vty/command.c
1 file changed, 8 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/vty/command.c b/src/vty/command.c
index 278ceb5..75bc00d 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2858,10 +2858,14 @@
 	struct cmd_node *cnode = vector_slot(cmdvec, vty->node);
 	struct cmd_element *cmd;
 
-	for (i = 0; i < vector_active(cnode->cmd_vector); i++)
-		if ((cmd = vector_slot(cnode->cmd_vector, i)) != NULL
-		    && !(cmd->attr & (CMD_ATTR_DEPRECATED | CMD_ATTR_HIDDEN)))
-			vty_out(vty, "  %s%s", cmd->string, VTY_NEWLINE);
+	for (i = 0; i < vector_active(cnode->cmd_vector); i++) {
+		if ((cmd = vector_slot(cnode->cmd_vector, i)) == NULL)
+			continue;
+		if (cmd->attr & (CMD_ATTR_DEPRECATED | CMD_ATTR_HIDDEN))
+			continue;
+		vty_out(vty, "  %s%s", cmd->string, VTY_NEWLINE);
+	}
+
 	return CMD_SUCCESS;
 }
 

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id1c082d102b7156dafb9c5d9197dcdc4d26bff63
Gerrit-Change-Number: 19573
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200815/b5bc78d9/attachment.htm>


More information about the gerrit-log mailing list