From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#45562: [PATCH] Fix "comparison always the same" warnings found by lgtm Date: Fri, 01 Jan 2021 12:08:46 +0100 Message-ID: <87h7o0c3sx.fsf@gnus.org> References: <83zh1ugj30.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6192"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45562@debbugs.gnu.org, Stefan Kangas To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 01 12:09:09 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 1kvIIv-0001WH-8e for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Jan 2021 12:09:09 +0100 Original-Received: from localhost ([::1]:34418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvIIu-0006li-BB for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Jan 2021 06:09:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvIIn-0006lF-W6 for bug-gnu-emacs@gnu.org; Fri, 01 Jan 2021 06:09:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvIIn-0000Rk-P5 for bug-gnu-emacs@gnu.org; Fri, 01 Jan 2021 06:09:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvIIn-0006XC-Jn for bug-gnu-emacs@gnu.org; Fri, 01 Jan 2021 06:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Jan 2021 11:09:01 +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.160949934125115 (code B ref 45562); Fri, 01 Jan 2021 11:09:01 +0000 Original-Received: (at 45562) by debbugs.gnu.org; 1 Jan 2021 11:09:01 +0000 Original-Received: from localhost ([127.0.0.1]:55482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvIIm-0006Wy-Rw for submit@debbugs.gnu.org; Fri, 01 Jan 2021 06:09:01 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:56896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvIIl-0006Wl-Bq for 45562@debbugs.gnu.org; Fri, 01 Jan 2021 06:08:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yDCKio6Jx/DrMbzPSRORPBf8U/aA+hn1NoABf9LSPO4=; b=nzZm4dFr8xh/R+I82Qg/r1wUZo vh7EIF8GkctOdWffBNj+hk9asZsdQZ+Jx9wfuZzAeNLYdz+MaxSQydFDtruWAvYazhsswHj64xO+N /bvG4pCqck+Wkv4mjSk4YqmE5UQQfXuyxm0gYVSS+xHJ/BK1ILmQTJkRl9o1WGKSCleE=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kvIIa-0000KK-5u; Fri, 01 Jan 2021 12:08:52 +0100 X-Now-Playing: Eurythmics's _Touch_: "Here Comes The Rain Again" In-Reply-To: <83zh1ugj30.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 31 Dec 2020 16:12:51 +0200") 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:197120 Archived-At: Eli Zaretskii writes: >> --- 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. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no