You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2019/01/23 13:42:16 UTC

[incubator-iotdb] branch fix_sonar updated: remove unused if()

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

hxd pushed a commit to branch fix_sonar
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/fix_sonar by this push:
     new a251841  remove unused if()
     new 231381c  Merge branch 'fix_sonar' of github.com:apache/incubator-iotdb into fix_sonar
a251841 is described below

commit a2518415ad9f0f538e2d68456e76ef10344fb2eb
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Wed Jan 23 21:41:44 2019 +0800

    remove unused if()
---
 .../main/java/org/apache/iotdb/tsfile/write/chunk/ChunkBuffer.java   | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkBuffer.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkBuffer.java
index 315f67a..6ab899e 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkBuffer.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkBuffer.java
@@ -107,13 +107,10 @@ public class ChunkBuffer {
     if (compressor.getType().equals(CompressionType.UNCOMPRESSED)) {
       compressedSize = data.remaining();
     } else {
-      // data is never a directByteBuffer now.
-      if (compressedBytes == null
-          || compressedBytes.length < compressor.getMaxBytesForCompression(uncompressedSize)) {
         compressedBytes = new byte[compressor.getMaxBytesForCompression(uncompressedSize)];
-      }
       try {
         compressedPosition = 0;
+        // data is never a directByteBuffer now, so we can use data.array()
         compressedSize = compressor
             .compress(data.array(), data.position(), data.remaining(), compressedBytes);
       } catch (IOException e) {