From 58c6ecc091f75783bdfb1342a033483bd85206b8 Mon Sep 17 00:00:00 2001 From: Marlene Cota Date: Tue, 30 Apr 2024 11:12:57 -0700 Subject: [PATCH] static_cast(id) --- include/fmt/base.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 00de04af3d53..772bc02ab9f0 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1899,12 +1899,10 @@ template class basic_format_args { if (id < max_size()) arg = args_[id]; return arg; } - if (id >= detail::max_packed_args) return arg; + if (static_cast(id) >= detail::max_packed_args) return arg; arg.type_ = type(id); if (arg.type_ == detail::type::none_type) return arg; - if (id >= 0) { - arg.value_ = values_[id]; - } + arg.value_ = values_[id]; return arg; }