This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 1e129ec8096 Remove duplicate lookups in dictionary encoder (#12224)
1e129ec8096 is described below
commit 1e129ec8096e2faf827adb68442128697cc67734
Author: Mrquan <[email protected]>
AuthorDate: Fri Mar 22 23:37:52 2024 +0800
Remove duplicate lookups in dictionary encoder (#12224)
---
.../tsfile/encoding/encoder/DictionaryEncoder.java | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git
a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/DictionaryEncoder.java
b/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/DictionaryEncoder.java
index 4a55e143fc2..948edc6f85f 100644
---
a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/DictionaryEncoder.java
+++
b/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/DictionaryEncoder.java
@@ -61,14 +61,15 @@ public class DictionaryEncoder extends Encoder {
@Override
public void encode(Binary value, ByteArrayOutputStream out) {
- entryIndex.computeIfAbsent(
- value,
- v -> {
- indexEntry.add(v);
- mapSize += v.getLength();
- return entryIndex.size();
- });
- valuesEncoder.encode(entryIndex.get(value), out);
+ int i =
+ entryIndex.computeIfAbsent(
+ value,
+ v -> {
+ indexEntry.add(v);
+ mapSize += v.getLength();
+ return entryIndex.size();
+ });
+ valuesEncoder.encode(i, out);
}
@Override