You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2023/04/11 09:12:34 UTC

[iotdb] branch NeedLessContains1.1 created (now afb76ac2e6)

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a change to branch NeedLessContains1.1
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at afb76ac2e6 Improve ineffective check in ColumnEncoderFactory

This branch includes the following new commits:

     new afb76ac2e6 Improve ineffective check in ColumnEncoderFactory

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: Improve ineffective check in ColumnEncoderFactory

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch NeedLessContains1.1
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit afb76ac2e658cde3d648fdd6177ae629ee4261fd
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Tue Apr 11 17:09:37 2023 +0800

    Improve ineffective check in ColumnEncoderFactory
---
 .../iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java
index 18c93afeea..2ac585643a 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java
@@ -35,9 +35,10 @@ public class ColumnEncoderFactory {
   }
 
   public static ColumnEncoder get(ColumnEncoding columnEncoding) {
-    if (!encodingToEncoder.containsKey(columnEncoding)) {
+    ColumnEncoder res = encodingToEncoder.get(columnEncoding);
+    if (res == null) {
       throw new IllegalArgumentException("Unsupported column encoding: " + columnEncoding);
     }
-    return encodingToEncoder.get(columnEncoding);
+    return res;
   }
 }