Hi Xueming and Ulf,

Please review a few more optimizations to be added to the
current crop:

http://cr.openjdk.java.net/~martin/webrevs/openjdk7/Pattern-opt/


Have you tried to disassemble? :

    private static final boolean isSupplementary(int cp) {
         returnCharacter.isSurrogate((char)cp)  ||
//  in this case method should be namedisSupplementaryOrHigher():
//                cp>= Character.MIN_SUPPLEMENTARY_CODE_POINT);
                 Character.isSupplementaryCodePoint(cp);

    }

Maybe HotSpot would compile to same code.
Anyway I think, such functionality should belong to class Character.
And don't forget the 8-space indentation rule for line continuation. ;-)


Use Character.codePointCount(...) instead ;-)  :

countCodePoints(CharSequence seq)


-Ulf







Reply via email to