public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r10-10309] libstdc++: Don't check always-true condition [PR101965]
Date: Fri, 26 Nov 2021 16:35:06 +0000 (GMT)	[thread overview]
Message-ID: <20211126163506.4EF423857811@sourceware.org> (raw)

https://gcc.gnu.org/g:30033d9bb9d5e5303fadf448999f4f27e2693ed6

commit r10-10309-g30033d9bb9d5e5303fadf448999f4f27e2693ed6
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Aug 19 13:05:54 2021 +0100

    libstdc++: Don't check always-true condition [PR101965]
    
    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)

Diff:
---
 libstdc++-v3/include/std/charconv | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv
index cc7dd0e3758..daad423570a 100644
--- a/libstdc++-v3/include/std/charconv
+++ b/libstdc++-v3/include/std/charconv
@@ -335,12 +335,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);
 	  }


                 reply	other threads:[~2021-11-26 16:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211126163506.4EF423857811@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).