From: Hung-Weic Chiu Date: Wed, 10 May 2017 01:57:11 +0000 (+0000) Subject: - Solve the Coverity Scan PW.ASSIGN_WHERE_COMPARE_MEANT X-Git-Tag: reindent-master-before~183 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9bc221113cf05f6cce9db83b6b4ff30ad8a8685b;p=mirror%2Ffrr.git - Solve the Coverity Scan PW.ASSIGN_WHERE_COMPARE_MEANT - Minor refactoring Signed-off-by: Hung-Weic Chiu --- 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); }