On Wed, 2005-11-02 at 12:50 +0100, Jeroen Frijters wrote:
> Christian Thalinger wrote:
> > +if (offset + count < 0 || offset + count > ascii.length)
>
> You can write this more efficiently as:
>
> if (ascii.length - offset < count)
>
> (This assumes that offset and count have previously
On Wed, Nov 02, 2005 at 10:33:30AM -0500, Anthony Balkissoon wrote:
> Uhm, I think that offset and count probably wouldn't have been checked
> to be non-negative, otherwise why would they check that offset + count <
> 0 ?
That check is for overflow. But i'll make a patch for jeroen's
suggestion.
On Wed, 2005-11-02 at 12:50 +0100, Jeroen Frijters wrote:
> Christian Thalinger wrote:
> > +if (offset + count < 0 || offset + count > ascii.length)
>
> You can write this more efficiently as:
>
> if (ascii.length - offset < count)
>
> (This assumes that offset and count have previously
Christian Thalinger wrote:
> +if (offset + count < 0 || offset + count > ascii.length)
You can write this more efficiently as:
if (ascii.length - offset < count)
(This assumes that offset and count have previously been checked to be
non-negative.)
Regards,
Jeroen
_