Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 committed Oct 6, 2024
1 parent 2a5b290 commit 0e13c10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 2 additions & 7 deletions src/compression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,8 @@ function TranscodingStreams.startproc(codec::ZstdCompressor, mode::Symbol, error
return :error
end
end
code = reset!(codec.cstream)
if iserror(code)
error[] = ErrorException("zstd error resetting compression context")
:error
else
:ok
end
reset!(codec.cstream)
return :ok
end

if isdefined(TranscodingStreams, :pledgeinsize)
Expand Down
6 changes: 5 additions & 1 deletion src/libzstd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ function reset!(cstream::CStream)
res = LibZstd.ZSTD_CCtx_reset(cstream, LibZstd.ZSTD_reset_session_only)
reset!(cstream.ibuffer)
reset!(cstream.obuffer)
return res
if iserror(res)
# According to zstd.h "Resetting session never fails" so this branch should be unreachable.
error("unreachable")

Check warning on line 65 in src/libzstd.jl

View check run for this annotation

Codecov / codecov/patch

src/libzstd.jl#L65

Added line #L65 was not covered by tests
end
return
end

"""
Expand Down

0 comments on commit 0e13c10

Please sign in to comment.