bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45562: [PATCH] Fix "comparison always the same" warnings found by lg


From: Lars Ingebrigtsen
Subject: bug#45562: [PATCH] Fix "comparison always the same" warnings found by lgtm
Date: Fri, 01 Jan 2021 12:08:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]