classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches] FYI: BoxLayout fixlet


From: Roman Kennke
Subject: Re: [cp-patches] FYI: BoxLayout fixlet
Date: Wed, 05 Oct 2005 10:26:13 +0200

Hi Mark,

Am Dienstag, den 04.10.2005, 17:28 +0200 schrieb Mark Wielaard:
> Hi Roman,
> 
> On Tue, 2005-10-04 at 16:52 +0200, Roman Kennke wrote:
> >      // Sum up (maxSize - prefSize) over all children
> >      int sumDelta = 0;
> >      for (int i = 0; i < children.length; i++)
> > -      sumDelta += children[i].maximum - children[i].preferred;
> > +      {
> > +        sumDelta += children[i].maximum - children[i].preferred;
> > +        if (sumDelta < 0)
> > +          sumDelta = Integer.MAX_VALUE;
> > +      }
> 
> A comment here might be nice to explicitly tell the reader this is
> because of overflow.

Yeah, I'll insert one.

>  Also you can probably just break from the loop at
> this point since from then on you will always overflow with each next
> child.

Somehow I haven't thought of this. I'll add that along with the comment.

Thank you,
Roman

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

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