Hi

Both these classes set/get do this:

int bit = index & 0x3f;           // mod 64
long bitmask = 1L << bit;

Since bit has only 64 values, bitmask can only be 1, 10, 100... etc. I was
thinking that instead of doing the <<, we can have a static BIT_MASK array,
indexed by bit, and then we could use it to compute bitmask.

But that replaces a bitwise shift by an array access, so I'm not sure how
much more efficient it will be? If the array is *hot* and in the L1 cache,
then it's supposed to be faster?

Thoughts?

Shai

Reply via email to