From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#45562: [PATCH] Fix "comparison always the same" warnings found by lgtm Date: Fri, 01 Jan 2021 14:05:09 +0200 Message-ID: <83y2hcg8wa.fsf@gnu.org> References: <83zh1ugj30.fsf@gnu.org> <87h7o0c3sx.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1537"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45562@debbugs.gnu.org, stefan@marxist.se To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 01 13:06:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kvJC7-0000JV-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Jan 2021 13:06:11 +0100 Original-Received: from localhost ([::1]:53422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvJC6-0001EG-Fa for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Jan 2021 07:06:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvJBy-0001D1-Ub for bug-gnu-emacs@gnu.org; Fri, 01 Jan 2021 07:06:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvJBy-0003bB-Mv for bug-gnu-emacs@gnu.org; Fri, 01 Jan 2021 07:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvJBy-0001p0-G7 for bug-gnu-emacs@gnu.org; Fri, 01 Jan 2021 07:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Jan 2021 12:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 45562-submit@debbugs.gnu.org id=B45562.16095027396967 (code B ref 45562); Fri, 01 Jan 2021 12:06:02 +0000 Original-Received: (at 45562) by debbugs.gnu.org; 1 Jan 2021 12:05:39 +0000 Original-Received: from localhost ([127.0.0.1]:55659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvJBa-0001oJ-KI for submit@debbugs.gnu.org; Fri, 01 Jan 2021 07:05:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvJBa-0001o8-1B for 45562@debbugs.gnu.org; Fri, 01 Jan 2021 07:05:38 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50916) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvJBU-0003E3-Ac; Fri, 01 Jan 2021 07:05:32 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2666 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kvJBP-0008QD-3l; Fri, 01 Jan 2021 07:05:30 -0500 In-Reply-To: <87h7o0c3sx.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 01 Jan 2021 12:08:46 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197127 Archived-At: > From: Lars Ingebrigtsen > Cc: Stefan Kangas , 45562@debbugs.gnu.org > Date: Fri, 01 Jan 2021 12:08:46 +0100 > > >> --- a/src/alloc.c > >> +++ b/src/alloc.c > >> @@ -4001,7 +4001,7 @@ memory_full (size_t nbytes) > >> { > >> if (i == 0) > >> free (spare_memory[i]); > >> - else if (i >= 1 && i <= 4) > >> + else if (i <= 4) > >> lisp_align_free (spare_memory[i]); > >> else > >> lisp_free (spare_memory[i]); > > > > This is an optimization better left to the compiler, IMO. > > I think the change made the code slightly clearer, though? You don't > have to think about whether there's anything in the range between 0 and > >= 1. If you like the modified code better, I won't object.