internal/zstd: refactoring literals.go implementation to add decodeSymbol method #64031
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
In the zstd implementation, readLiteralsOneStream and readLiteralsFourStreams duplicate a lot of code, and for the sake of code maintainability, I suggest implementing the duplicated code into a decodeSymbol method.
The duplicate code is available at https://github.com/golang/go/blob/master/src/internal/zstd/literals.go#L283-L326
This part of the code is used between readLiteralsOneStream and readLiteralsFourStreams. According to RFC 8878 3.1.1.3.1.6
The logic of their implementation is exactly the same, a decodeSymbol method can be implemented
The decodeSymbol can be implemented in readLiteralsFourStreams and readLiteralsOneStream using the simplified code
The text was updated successfully, but these errors were encountered: