baumgold commented on code in PR #448:
URL: https://github.com/apache/arrow-julia/pull/448#discussion_r1215489558


##########
src/table.jl:
##########
@@ -570,10 +570,9 @@ function buildbitmap(batch, rb, nodeidx, bufferidx)
 end
 
 function uncompress(ptr::Ptr{UInt8}, buffer, compression)
-    if buffer.length == 0
-        return 0, UInt8[]
-    end
+    buffer.length == 0 && return 0, UInt8[]
     len = unsafe_load(convert(Ptr{Int64}, ptr))
+    len == 0 && return 0, UInt8[]

Review Comment:
   Maybe we should use iszero instead?
   
   ```suggestion
       iszero(len) && return 0, UInt8[]
   ```



##########
src/table.jl:
##########
@@ -570,10 +570,9 @@ function buildbitmap(batch, rb, nodeidx, bufferidx)
 end
 
 function uncompress(ptr::Ptr{UInt8}, buffer, compression)
-    if buffer.length == 0
-        return 0, UInt8[]
-    end
+    buffer.length == 0 && return 0, UInt8[]

Review Comment:
   maybe we should use iszero instead?
   
   ```suggestion
       iszero(buffer.length) && return 0, UInt8[]
   ```



-- 
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