codereview request: 6639443/ (original) (raw)

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.UCS4MIN;_ _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.UCS4MIN && 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