This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git
The following commit(s) were added to refs/heads/develop by this push:
new 5febf808 Remove duplicate lookups in dictionary encoder
5febf808 is described below
commit 5febf8087c141b9ca6e7a15d319c39235bc8c0fa
Author: Mrquan <[email protected]>
AuthorDate: Mon Apr 1 20:41:28 2024 +0800
Remove duplicate lookups in dictionary encoder
---
.../tsfile/encoding/encoder/DictionaryEncoder.java | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git
a/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/DictionaryEncoder.java
b/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/DictionaryEncoder.java
index df9e1046..4a6fde55 100644
---
a/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/DictionaryEncoder.java
+++
b/tsfile/src/main/java/org/apache/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