codereview request: 6639443/

Xueming Shen Xueming.Shen at Sun.COM
Fri Jul 17 16:14:45 UTC 2009


Martin Buchholz wrote:
>
>
> On Tue, Jul 14, 2009 at 12:50, Xueming Shen <Xueming.Shen at sun.com 
> <mailto:Xueming.Shen at sun.com>> wrote:
>
>
>     (2)
>
>     a)    return (int)(char) uc ==uc;
>
>       is nice:-) but I would go with the "more easy to read"
>
>       return uc < Surrogate.UCS4_MIN;
>
>       if it were my code. Is there a big performance gain by doing that?
>
>
> That's almost, but not exactly the same - uc might be negative.
> (I don't know whether that can ever happen, though)
>  
> My code is likely to be slightly faster than
>
> return uc < Surrogate.UCS4_MIN && uc >= 0;

While it might be slightly faster, the trick has the "dependency" on the 
size of "char". I still
remember the discussion of 32-bit char type when were planning 
supplementary support,
so everything is possible:-)

I don't think we are actually using the "generate()" anyway in our code 
(or least in the
latest version), maybe we can simply remove the piece.

I'm OK to putback the change asis though.

Sherman


>
>
>     b) The "buffer" version and the "array" version of generate() are
>     not synced.
>
>
> Yikes!  Good catch.  Fixed - webrev regenerated.
>  
> Thanks,
>
> Martin




More information about the core-libs-dev mailing list