From 916ed99dabc9bcee3b0a90b94473475b9a74203c Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 14 Jul 2018 15:28:55 -0700 Subject: [PATCH] Micro-optimize argument retrieval --- include/fmt/core.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 4e3a7062..739d6dee 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1129,8 +1129,9 @@ class basic_format_args { /** Returns the argument at specified index. */ format_arg get(size_type index) const { format_arg arg = do_get(index); - return arg.type_ == internal::named_arg_type ? - arg.value_.as_named_arg().template deserialize() : arg; + if (arg.type_ == internal::named_arg_type) + arg = arg.value_.as_named_arg().template deserialize(); + return arg; } unsigned max_size() const {