Peculiar fruits in the JDK

Ulf Zibis Ulf.Zibis at CoSoCo.de
Wed Jun 25 08:57:49 UTC 2008


Hi David,

can you show an example using a 'switch' statement which is shorter or 
faster than:

            char c = c2bMap.charAt(c2bMapIndex[(current & MASK1) >> 
SHIFT] + (current & MASK2));

or more faster for special mappings:

            char c = (current < '\u0100') ? c2bMap.charAt(current) :
                c2bMap.charAt(c2bMapIndex[(current & MASK1) >> SHIFT] + 
(current & MASK2));

Regards,
Ulf


Am 24.06.2008 18:15, David M. Lloyd schrieb:
> On 06/24/2008 11:08 AM, Ulf Zibis wrote:
>> I many cases I also could shorten the encoding mappings.
>>
>> Example: 
>> https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/milestone1/src/sun/nio/cs/ext/IBM870.java?rev=223&view=markup 
>
>
> Would a 'switch' statement not be more speed- and space-efficient for 
> this type of lookup task?
>
> - DML
>
>
>




More information about the core-libs-dev mailing list