From 2b27f0241d40c90f73505756447e76b52bd0be62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lecaros?= Date: Tue, 17 Oct 2023 09:18:09 -0500 Subject: [PATCH] out_chronicle: remove redundant code (#8004) These initializations are redundant. The variables are already initialized with these values and there's no code that could change them until this point. Signed-off-by: lecaros --- plugins/out_chronicle/chronicle.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/plugins/out_chronicle/chronicle.c b/plugins/out_chronicle/chronicle.c index 479dd803566..b01fef22569 100644 --- a/plugins/out_chronicle/chronicle.c +++ b/plugins/out_chronicle/chronicle.c @@ -518,7 +518,6 @@ static flb_sds_t flb_pack_msgpack_extract_log_key(void *out_context, uint64_t by int i; int map_size; int check = FLB_FALSE; - int found = FLB_FALSE; int log_key_missing = 0; int ret; struct flb_chronicle *ctx = out_context; @@ -550,10 +549,6 @@ static flb_sds_t flb_pack_msgpack_extract_log_key(void *out_context, uint64_t by map_size = map.via.map.size; - /* Reset variables for found log_key and correct type */ - found = FLB_FALSE; - check = FLB_FALSE; - /* Extract log_key from record and append to output buffer */ for (i = 0; i < map_size; i++) { key = map.via.map.ptr[i].key; @@ -572,7 +567,6 @@ static flb_sds_t flb_pack_msgpack_extract_log_key(void *out_context, uint64_t by if (check == FLB_TRUE) { if (strncmp(ctx->log_key, key_str, key_str_size) == 0) { - found = FLB_TRUE; /* * Copy contents of value into buffer. Necessary to copy @@ -607,9 +601,7 @@ static flb_sds_t flb_pack_msgpack_extract_log_key(void *out_context, uint64_t by } /* If log_key was not found in the current record, mark log key as missing */ - if (found == FLB_FALSE) { - log_key_missing++; - } + log_key_missing++; } if (log_key_missing > 0) {