Am 11.03.2010 20:56, schrieb Martin Buchholz:
Why isn't this true for isSupplementaryCodePoint() too ?
Particularly there the "cheap" compare against 0 can't be benefited.
Because almost all code points are actually BMP,
the naive implementation of isValidCodePoint will
almost always req
On Thu, Mar 11, 2010 at 10:25, Ulf Zibis wrote:
> Am 11.03.2010 05:42, schrieb Martin Buchholz:
>>
>> I couldn't resist making a similar change to isValidCodePoint.
>>
>> @@ -2678,7 +2678,8 @@
>> * @since 1.5
>> */
>> public static boolean isValidCodePoint(int codePoint) {
>> -
Am 11.03.2010 05:42, schrieb Martin Buchholz:
I couldn't resist making a similar change to isValidCodePoint.
@@ -2678,7 +2678,8 @@
* @since 1.5
*/
public static boolean isValidCodePoint(int codePoint) {
-return codePoint>= MIN_CODE_POINT&& codePoint<= MAX_CODE_POINT
I couldn't resist too ;-) . See:
https://bugs.openjdk.java.net/attachment.cgi?id=178&action=diff
Download:
https://bugs.openjdk.java.net/attachment.cgi?id=178
Please have in mind:
- the performance advantage as pair only occurs, if isBMPCodePoint too
uses logical shift '>>>'.
- String(int[] cod
I couldn't resist making a similar change to isValidCodePoint.
@@ -2678,7 +2678,8 @@
* @since 1.5
*/
public static boolean isValidCodePoint(int codePoint) {
-return codePoint >= MIN_CODE_POINT && codePoint <= MAX_CODE_POINT;
+int plane = codePoint >>> 16;
+
On Wed, Mar 10, 2010 at 09:58, Ulf Zibis wrote:
> Hi Martin,
>
> there wasn't enough time today, so please wait for tomorrow.
>
> In brief:
> - I wouldn't rename to isBMPCodePoint(), because there are many other names
> in Surrogate class that don't sync to Character and and a usages search in
> s
Hi Martin,
there wasn't enough time today, so please wait for tomorrow.
In brief:
- I wouldn't rename to isBMPCodePoint(), because there are many other
names in Surrogate class that don't sync to Character and and a usages
search in sun.nio.cs.* or where ever else could be omitted. Better add