From ec9f227eae1794aa6106bbc25532e4b1281c81fd Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 5 Dec 2017 11:59:30 +0800 Subject: [PATCH] apps/altcp_tls: Remove redundant check for altcp_mbedtls_malloc_clear_stats No need to check altcp_mbedtls_malloc_clear_stats twice. Signed-off-by: Axel Lin Signed-off-by: goldsimon --- src/apps/altcp_tls/altcp_tls_mbedtls_mem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/apps/altcp_tls/altcp_tls_mbedtls_mem.c b/src/apps/altcp_tls/altcp_tls_mbedtls_mem.c index 691232c1..04d47ae5 100644 --- a/src/apps/altcp_tls/altcp_tls_mbedtls_mem.c +++ b/src/apps/altcp_tls/altcp_tls_mbedtls_mem.c @@ -107,10 +107,8 @@ tls_malloc(size_t c, size_t len) size_t alloc_size; #if ALTCP_MBEDTLS_PLATFORM_ALLOC_STATS if (altcp_mbedtls_malloc_clear_stats) { - if (altcp_mbedtls_malloc_clear_stats) { - altcp_mbedtls_malloc_clear_stats = 0; - memset(&altcp_mbedtls_malloc_stats, 0, sizeof(altcp_mbedtls_malloc_stats)); - } + altcp_mbedtls_malloc_clear_stats = 0; + memset(&altcp_mbedtls_malloc_stats, 0, sizeof(altcp_mbedtls_malloc_stats)); } #endif alloc_size = sizeof(altcp_mbedtls_malloc_helper_t) + (c * len);