From 72785a3abadb1440bd69759feb2d9e4718014504 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 30 Dec 2022 13:53:55 -0800 Subject: [PATCH] Cleanup write --- include/fmt/format.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 0da5607a..795ffa2c 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3456,11 +3456,8 @@ FMT_CONSTEXPR auto write(OutputIt out, Char value) -> OutputIt { template FMT_CONSTEXPR_CHAR_TRAITS auto write(OutputIt out, const Char* value) -> OutputIt { - if (!value) { - throw_format_error("string pointer is null"); - } else { - out = write(out, basic_string_view(value)); - } + if (value) return write(out, basic_string_view(value)); + throw_format_error("string pointer is null"); return out; }