From b3e6d017a5045e7d6a5828bc0a59066da03c216a Mon Sep 17 00:00:00 2001 From: moiwi <71585945+moiwi@users.noreply.github.com> Date: Fri, 5 Mar 2021 09:52:54 +0100 Subject: [PATCH] Update format.h optimize loop --- include/fmt/format.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 065aa496..d7bb9b0a 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -759,7 +759,7 @@ using is_fast_float = bool_constant::is_iec559 && template template void buffer::append(const U* begin, const U* end) { - do { + while (begin != end) { auto count = to_unsigned(end - begin); try_reserve(size_ + count); auto free_cap = capacity_ - size_; @@ -767,7 +767,7 @@ void buffer::append(const U* begin, const U* end) { std::uninitialized_copy_n(begin, count, make_checked(ptr_ + size_, count)); size_ += count; begin += count; - } while (begin != end); + } } template