From 6f50e21936b0900d71be19e89532002c8aa06a49 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 12 Aug 2020 17:32:18 +0700 Subject: vty/command: cosmetic: simplify conditions in in config_list_cmd Change-Id: Id1c082d102b7156dafb9c5d9197dcdc4d26bff63 --- src/vty/command.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/vty') diff --git a/src/vty/command.c b/src/vty/command.c index 278ceb5d..75bc00de 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2858,10 +2858,14 @@ gDEFUN(config_list, config_list_cmd, "list", "Print command list\n") 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; } -- cgit v1.2.3