[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: optimal-page-breaking.cc protect unsigned subtraction; issue 1553 (i
From: |
David Kastrup |
Subject: |
Re: optimal-page-breaking.cc protect unsigned subtraction; issue 1553 (issue 22750045) |
Date: |
Fri, 22 Nov 2013 07:07:26 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
"Keith OHara" <address@hidden> writes:
> On Thu, 21 Nov 2013 01:34:46 -0800, <address@hidden> wrote:
>
>> How about
>> if (min_sys_count > ideal_sys_count // subtraction wrapped around
>> || min_sys_count <= 0)
>> min_sys_count = 1;
>>
>> Saves you the min thing.
>
> That is compact, but I want to keep the min thing separate for code
> history. The two fixups of min_sys_count came from different people
> at different times.
So what?
> This code is not run often enough that I worry about an extra test and branch.
I worry about robustness and readability. This checks min_syscount to
be in range and corrects it if is out of range. The current proposal
takes two different operations, bounces it back and forth, and needs a
min operation with casts.
--
David Kastrup