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. Also you can probably just break from the loop at
this point since from then on you will always overflow with each next
child.

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to