/** * Batch hash code implementation that works at its best if {@code bytes} * contains a {@link org.apache.activemq.artemis.api.core.SimpleString} encoded. */ private static int hashCode(final ByteBuf bytes, final int offset, final int length) { if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { //if the platform allows it, the hash code could be computed without bounds checking if (bytes.hasArray()) { return onHeapHashCode(bytes.array(), bytes.arrayOffset() + offset, length); } else if (bytes.hasMemoryAddress()) { return offHeapHashCode(bytes.memoryAddress(), offset, length); } } return byteBufHashCode(bytes, offset, length); }
if (!canPool(byteBuf, length)) { return create(byteBuf, length); } else { if (!byteBuf.isReadable(length)) { final int hashCode = hashCode(byteBuf, bytesOffset, length); if (isEqual(firstEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return firstEntry; if (isEqual(secondEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return secondEntry; final T internedEntry = create(byteBuf, length); final int entryIndex = firstEntry == null ? firstIndex : secondIndex; entries[entryIndex] = internedEntry;
if (!canPool(byteBuf, length)) { return create(byteBuf, length); } else { if (!byteBuf.isReadable(length)) { final int hashCode = hashCode(byteBuf, bytesOffset, length); if (isEqual(firstEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return firstEntry; if (isEqual(secondEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return secondEntry; final T internedEntry = create(byteBuf, length); final int entryIndex = firstEntry == null ? firstIndex : secondIndex; entries[entryIndex] = internedEntry;
/** * Batch hash code implementation that works at its best if {@code bytes} * contains a {@link org.apache.activemq.artemis.api.core.SimpleString} encoded. */ private static int hashCode(final ByteBuf bytes, final int offset, final int length) { if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { //if the platform allows it, the hash code could be computed without bounds checking if (bytes.hasArray()) { return onHeapHashCode(bytes.array(), bytes.arrayOffset() + offset, length); } else if (bytes.hasMemoryAddress()) { return offHeapHashCode(bytes.memoryAddress(), offset, length); } } return byteBufHashCode(bytes, offset, length); }
if (!canPool(byteBuf, length)) { return create(byteBuf, length); } else { if (!byteBuf.isReadable(length)) { final int hashCode = hashCode(byteBuf, bytesOffset, length); if (isEqual(firstEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return firstEntry; if (isEqual(secondEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return secondEntry; final T internedEntry = create(byteBuf, length); final int entryIndex = firstEntry == null ? firstIndex : secondIndex; entries[entryIndex] = internedEntry;
/** * Batch hash code implementation that works at its best if {@code bytes} * contains a {@link org.apache.activemq.artemis.api.core.SimpleString} encoded. */ private static int hashCode(final ByteBuf bytes, final int offset, final int length) { if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { //if the platform allows it, the hash code could be computed without bounds checking if (bytes.hasArray()) { return onHeapHashCode(bytes.array(), bytes.arrayOffset() + offset, length); } else if (bytes.hasMemoryAddress()) { return offHeapHashCode(bytes.memoryAddress(), offset, length); } } return byteBufHashCode(bytes, offset, length); }
if (!canPool(byteBuf, length)) { return create(byteBuf, length); } else { if (!byteBuf.isReadable(length)) { final int hashCode = hashCode(byteBuf, bytesOffset, length); if (isEqual(firstEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return firstEntry; if (isEqual(secondEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return secondEntry; final T internedEntry = create(byteBuf, length); final int entryIndex = firstEntry == null ? firstIndex : secondIndex; entries[entryIndex] = internedEntry;
/** * Batch hash code implementation that works at its best if {@code bytes} * contains a {@link org.apache.activemq.artemis.api.core.SimpleString} encoded. */ private static int hashCode(final ByteBuf bytes, final int offset, final int length) { if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { //if the platform allows it, the hash code could be computed without bounds checking if (bytes.hasArray()) { return onHeapHashCode(bytes.array(), bytes.arrayOffset() + offset, length); } else if (bytes.hasMemoryAddress()) { return offHeapHashCode(bytes.memoryAddress(), offset, length); } } return byteBufHashCode(bytes, offset, length); }
if (!canPool(byteBuf, length)) { return create(byteBuf, length); } else { if (!byteBuf.isReadable(length)) { final int hashCode = hashCode(byteBuf, bytesOffset, length); if (isEqual(firstEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return firstEntry; if (isEqual(secondEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return secondEntry; final T internedEntry = create(byteBuf, length); final int entryIndex = firstEntry == null ? firstIndex : secondIndex; entries[entryIndex] = internedEntry;
/** * Batch hash code implementation that works at its best if {@code bytes} * contains a {@link org.apache.activemq.artemis.api.core.SimpleString} encoded. */ private static int hashCode(final ByteBuf bytes, final int offset, final int length) { if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { //if the platform allows it, the hash code could be computed without bounds checking if (bytes.hasArray()) { return onHeapHashCode(bytes.array(), bytes.arrayOffset() + offset, length); } else if (bytes.hasMemoryAddress()) { return offHeapHashCode(bytes.memoryAddress(), offset, length); } } return byteBufHashCode(bytes, offset, length); }
if (!canPool(byteBuf, length)) { return create(byteBuf, length); } else { if (!byteBuf.isReadable(length)) { final int hashCode = hashCode(byteBuf, bytesOffset, length); if (isEqual(firstEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return firstEntry; if (isEqual(secondEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return secondEntry; final T internedEntry = create(byteBuf, length); final int entryIndex = firstEntry == null ? firstIndex : secondIndex; entries[entryIndex] = internedEntry;
/** * Batch hash code implementation that works at its best if {@code bytes} * contains a {@link org.apache.activemq.artemis.api.core.SimpleString} encoded. */ private static int hashCode(final ByteBuf bytes, final int offset, final int length) { if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { //if the platform allows it, the hash code could be computed without bounds checking if (bytes.hasArray()) { return onHeapHashCode(bytes.array(), bytes.arrayOffset() + offset, length); } else if (bytes.hasMemoryAddress()) { return offHeapHashCode(bytes.memoryAddress(), offset, length); } } return byteBufHashCode(bytes, offset, length); }
if (!canPool(byteBuf, length)) { return create(byteBuf, length); } else { if (!byteBuf.isReadable(length)) { final int hashCode = hashCode(byteBuf, bytesOffset, length); if (isEqual(firstEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return firstEntry; if (isEqual(secondEntry, byteBuf, bytesOffset, length)) { byteBuf.skipBytes(length); return secondEntry; final T internedEntry = create(byteBuf, length); final int entryIndex = firstEntry == null ? firstIndex : secondIndex; entries[entryIndex] = internedEntry;
/** * Batch hash code implementation that works at its best if {@code bytes} * contains a {@link org.apache.activemq.artemis.api.core.SimpleString} encoded. */ private static int hashCode(final ByteBuf bytes, final int offset, final int length) { if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { //if the platform allows it, the hash code could be computed without bounds checking if (bytes.hasArray()) { return onHeapHashCode(bytes.array(), bytes.arrayOffset() + offset, length); } else if (bytes.hasMemoryAddress()) { return offHeapHashCode(bytes.memoryAddress(), offset, length); } } return byteBufHashCode(bytes, offset, length); }