From 9bc221113cf05f6cce9db83b6b4ff30ad8a8685b Mon Sep 17 00:00:00 2001 From: Hung-Weic Chiu Date: Wed, 10 May 2017 01:57:11 +0000 Subject: [PATCH] - Solve the Coverity Scan PW.ASSIGN_WHERE_COMPARE_MEANT - Minor refactoring Signed-off-by: Hung-Weic Chiu --- lib/command.c | 5 ++++- tools/permutations.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/command.c b/lib/command.c index 11c9a0968b..03092ed184 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1623,8 +1623,11 @@ permute (struct graph_node *start, struct vty *vty) bool skip = false; if (stok->type == FORK_TKN && tok->type != FORK_TKN) for (ALL_LIST_ELEMENTS_RO (position, ln, gnn)) - if (gnn == gn && (skip = true)) + if (gnn == gn) + { + skip = true; break; + } if (!skip) permute (gn, vty); } diff --git a/tools/permutations.c b/tools/permutations.c index 6e1a37981a..88d1464697 100644 --- a/tools/permutations.c +++ b/tools/permutations.c @@ -87,8 +87,11 @@ permute (struct graph_node *start) bool skip = false; if (stok->type == FORK_TKN && tok->type != FORK_TKN) for (ALL_LIST_ELEMENTS_RO (position, ln, gnn)) - if (gnn == gn && (skip = true)) + if (gnn == gn) + { + skip = true; break; + } if (!skip) permute (gn); } -- 2.39.5