lilypond-devel
[Top][All Lists]
Advanced

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

Re: optimal-page-breaking.cc protect unsigned subtraction; issue 1553 (i


From: dak
Subject: Re: optimal-page-breaking.cc protect unsigned subtraction; issue 1553 (issue 22750045)
Date: Thu, 21 Nov 2013 09:34:46 +0000


https://codereview.appspot.com/22750045/diff/20001/lily/optimal-page-breaking.cc
File lily/optimal-page-breaking.cc (right):

https://codereview.appspot.com/22750045/diff/20001/lily/optimal-page-breaking.cc#newcode78
lily/optimal-page-breaking.cc:78: if (min_sys_count > ideal_sys_count)
// subtraction wrapped around
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.  <= instead of == just so that we don't really
need to know that vsize is unsigned.

https://codereview.appspot.com/22750045/



reply via email to

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