Chris Burdess wrote: > Tom Tromey wrote: > > Chris> Please comment. > > > > Chris> - dst[dstIndex + 1] = (char) ((codePoint & 0x3ff) > > Chris> - + (int) > MIN_LOW_SURROGATE ); > > Chris> - dst[dstIndex] = (char) ((codePoint >> 10) + > (int) MIN_HIGH_SURROGATE); > > Chris> + dst[dstIndex + 1] = (char) (((codePoint - > 0x10000) % 0x400) + 0xdc00); > > Chris> + dst[dstIndex] = (char) (((codePoint - > 0x10000) / 0x400) + 0xd800); > > > > I think it is better to use the named constants instead of > the values. > > Fair enough, but what about the casting: doesn't that make it > less efficient?
No, it's a no-op (and not even needed in the source). > > I also have a mild preference for the bit-shifting and masking > > computation, but this is more minor. > > The problem is that the bit-shifting method produces the wrong result. In this case they both produce the same result. I think the problem was that the original code forgot to subtract 0x10000. Regards, Jeroen _______________________________________________ Classpath-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath-patches
