From 79ef3479e74764aaa8bd3d0ff97d9834466b8911 Mon Sep 17 00:00:00 2001 From: MrQuansy Date: Thu, 21 Nov 2024 16:50:12 +0800 Subject: [PATCH] resolve comments --- .../java/org/apache/tsfile/utils/PooledBinary.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/java/common/src/main/java/org/apache/tsfile/utils/PooledBinary.java b/java/common/src/main/java/org/apache/tsfile/utils/PooledBinary.java index e10819944..d66b283f3 100644 --- a/java/common/src/main/java/org/apache/tsfile/utils/PooledBinary.java +++ b/java/common/src/main/java/org/apache/tsfile/utils/PooledBinary.java @@ -18,8 +18,6 @@ */ package org.apache.tsfile.utils; -import jdk.internal.util.ArraysSupport; - import java.io.Serializable; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -105,8 +103,16 @@ public boolean equals(Object o) { return false; } - return ArraysSupport.mismatch(binary.getValues(), 0, otherBinary.binary.getValues(), 0, length) - == -1; + byte[] v0 = binary.getValues(); + byte[] v1 = otherBinary.binary.getValues(); + + for (int i = 0; i < length; i++) { + if (v0[i] != v1[i]) { + return false; + } + } + + return true; } @Override