Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix case where compressed file reports non-zero buffer length #448

Merged
merged 1 commit into from
Jun 5, 2023
Merged

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Jun 3, 2023

Fixes #437. Thanks to @DrChainsaw for the investigation, proposed fix, and test file.

Fixes #437. Thanks to @DrChainsaw for the investigation, proposed fix,
and test file.
@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2023

Codecov Report

Merging #448 (0b0c8be) into main (784b27b) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #448   +/-   ##
=======================================
  Coverage   87.49%   87.49%           
=======================================
  Files          26       26           
  Lines        3271     3271           
=======================================
  Hits         2862     2862           
  Misses        409      409           
Impacted Files Coverage Δ
src/table.jl 92.49% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@baumgold baumgold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

len = unsafe_load(convert(Ptr{Int64}, ptr))
len == 0 && return 0, UInt8[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should use iszero instead?

Suggested change
len == 0 && return 0, UInt8[]
iszero(len) && return 0, UInt8[]

if buffer.length == 0
return 0, UInt8[]
end
buffer.length == 0 && return 0, UInt8[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should use iszero instead?

Suggested change
buffer.length == 0 && return 0, UInt8[]
iszero(buffer.length) && return 0, UInt8[]

@quinnj quinnj merged commit e57bdab into main Jun 5, 2023
@quinnj quinnj deleted the jq-437 branch June 5, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure to read compressed empty table from java implementation
3 participants