]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: map, stream: remove duplicate code in src/map.c, src/stream.c
authorIlya Shipitsin <chipitsine@gmail.com>
Fri, 23 Mar 2018 12:41:48 +0000 (17:41 +0500)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Mar 2018 17:00:09 +0000 (18:00 +0100)
issue was identified by cppcheck

[src/map.c:372] -> [src/map.c:376]: (warning) Variable 'appctx->st2' is reassigned a value before the old one has been used. 'break;' missing?
[src/map.c:433] -> [src/map.c:437]: (warning) Variable 'appctx->st2' is reassigned a value before the old one has been used. 'break;' missing?
[src/map.c:555] -> [src/map.c:559]: (warning) Variable 'appctx->st2' is reassigned a value before the old one has been used. 'break;' missing?
[src/stream.c:3264] -> [src/stream.c:3268]: (warning) Variable 'appctx->st2' is reassigned a value before the old one has been used. 'break;' missing?

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
src/map.c
src/stream.c

index fb4117327127d2fa5d3e00bd940eaceb06ebbcec..9313dc87e4b6dc299319afc68babff5abdc810fa 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -369,7 +369,6 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
                        appctx->ctx.map.bref.ref = elt->list.n;
                }
                HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
-               appctx->st2 = STAT_ST_FIN;
                /* fall through */
 
        default:
@@ -430,7 +429,6 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
                                                                appctx->ctx.map.display_flags);
                }
 
-               appctx->st2 = STAT_ST_FIN;
                /* fall through */
 
        default:
@@ -552,7 +550,6 @@ static int cli_io_handler_map_lookup(struct appctx *appctx)
                                                                 &appctx->ctx.map.ref->pat);
                }
                HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
-               appctx->st2 = STAT_ST_FIN;
                /* fall through */
 
        default:
index 38d724006f7c31506a0b853bf24df3cdbe05069a..2d8f27834cf50e178a671e459b84b5a6a1585618 100644 (file)
@@ -3261,7 +3261,6 @@ static int cli_io_handler_dump_sess(struct appctx *appctx)
                }
 
                HA_SPIN_UNLOCK(STRMS_LOCK, &streams_lock);
-               appctx->st2 = STAT_ST_FIN;
                /* fall through */
 
        default: