Marcono1234 commented on code in PR #3555:
URL: https://github.com/apache/celeborn/pull/3555#discussion_r2607501099


##########
client/src/main/java/org/apache/celeborn/client/compress/Lz4Decompressor.java:
##########
@@ -68,7 +68,7 @@ public int decompress(byte[] src, byte[] dst, int dstOff) 
throws IOException {
         System.arraycopy(src, HEADER_LENGTH, dst, dstOff, originalLen);
         break;
       case COMPRESSION_METHOD_LZ4:
-        int compressedLen2 = decompressor.decompress(src, HEADER_LENGTH, dst, 
dstOff, originalLen);
+        int compressedLen2 = decompressor.decompress(src, HEADER_LENGTH, 
originalLen, dst, dstOff);

Review Comment:
   Is this really correct? The signature is `decompress(byte[] src, int srcOff, 
int srcLen, byte[] dest, int destOff)` and the return value is "the original 
input size".
   
   So should this rather be:
   
   ```suggestion
           int originalLen2 = decompressor.decompress(src, HEADER_LENGTH, 
compressedLen, dst, dstOff);
   ```
   
   (The API of `LZ4FastDecompressor` and `LZ4SafeDecompressor` differs; the 
'fast' decompressor takes the expected output size and returns the consumed 
input size, whereas the 'safe'  decompressor takes the expected input size and 
returns the produced output size.)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to