From 02d5ab8478e7c840c6c8877d46f81f1f62c0f640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Sun, 19 Jul 2020 15:06:49 -0400 Subject: [PATCH] refactor: avoid always false comparison --- src/include/units/symbol_text.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/include/units/symbol_text.h b/src/include/units/symbol_text.h index e879bdaf..ca9d09a0 100644 --- a/src/include/units/symbol_text.h +++ b/src/include/units/symbol_text.h @@ -13,8 +13,9 @@ template constexpr void validate_ascii_string([[maybe_unused]] const char (&s)[P + 1]) noexcept { #ifndef NDEBUG - for (size_t i = 0; i < P; ++i) - validate_ascii_char(s[i]); + if constexpr (P != 0) + for (size_t i = 0; i < P; ++i) + validate_ascii_char(s[i]); #endif }