]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Don't check always-true condition [PR101965]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 19 Aug 2021 12:05:54 +0000 (13:05 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 24 Aug 2021 14:19:14 +0000 (15:19 +0100)
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/101965
* include/std/charconv (__to_chars_i): Remove redundant check.

(cherry picked from commit 85a709595005b5df4b2ee9d81717a5df19c0023f)

libstdc++-v3/include/std/charconv

index 64a6606bb33872127d1f9f8b7c23e4005fd21335..8572e376c92a0a4a6fc3673604b65e2e62b2acbc 100644 (file)
@@ -336,12 +336,10 @@ namespace __detail
          *__first = '0';
          return { __first + 1, errc{} };
        }
-
-      if _GLIBCXX17_CONSTEXPR (std::is_signed<_Tp>::value)
+      else if _GLIBCXX17_CONSTEXPR (std::is_signed<_Tp>::value)
        if (__value < 0)
          {
-           if (__builtin_expect(__first != __last, 1))
-             *__first++ = '-';
+           *__first++ = '-';
            __unsigned_val = _Up(~__value) + _Up(1);
          }