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

_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to