From 6383a78dd2763edaf1b7941862c7a569921694b6 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Mon, 9 Nov 2026 20:17:18 +0300 Subject: [PATCH] [Core] scan-build: switch_cache_db_type_name(). Value stored to 'type_str' during its initialization is never read (#3273) --- src/include/switch_core.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/include/switch_core.h b/src/include/switch_core.h index 40f126a818..887c4d4241 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -2625,27 +2625,16 @@ typedef struct switch_cache_db_handle switch_cache_db_handle_t; static inline const char *switch_cache_db_type_name(switch_cache_db_handle_type_t type) { - const char *type_str = "INVALID"; - switch (type) { case SCDB_TYPE_DATABASE_INTERFACE: - { - type_str = "DATABASE_INTERFACE"; - } - break; + return "DATABASE_INTERFACE"; case SCDB_TYPE_ODBC: - { - type_str = "ODBC"; - } - break; + return "ODBC"; case SCDB_TYPE_CORE_DB: - { - type_str = "CORE_DB"; - } - break; + return "CORE_DB"; + default: + return "INVALID"; } - - return type_str; } SWITCH_DECLARE(switch_cache_db_handle_type_t) switch_cache_db_get_type(switch_cache_db_handle_t *dbh);