Вопрос по java – Какова цель сдвига битового значения int на ноль?

11

Глядя на исходный код класса java.nio.DirectByteBuffer, я нашел это:

if ((length << 0) > Bits.JNI_COPY_TO_ARRAY_THRESHOLD) ....

Какова цель смещения длины на ноль битов? Может ли это быть какая-то оптимизация производительности или что-то еще?

Error: User Rate Limit Exceeded Thomas Jungblut
Error: User Rate Limit Exceeded Marc
Error: User Rate Limit Exceeded Steve McLeod
Error: User Rate Limit Exceeded Steve McLeod
Error: User Rate Limit Exceeded Thomas Jungblut

Ваш Ответ

3   ответа
16

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

// -- This file was mechanically generated: Do not edit! -- //

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
3

Error: User Rate Limit Exceededi << 0Error: User Rate Limit Exceededi.

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededwhat's the purposeError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
2

Error: User Rate Limit Exceededi << 0Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

  • written by someone who wasn't thinking,
  • written by someone who doesn't understand what the << operator does,
  • the result of some semi-mechanical refactoring, or
  • originally produced by some sort of code generator or translator.

Error: User Rate Limit Exceeded

Похожие вопросы