Skip to content

Commit

Permalink
make possible to override decompressor for existed method
Browse files Browse the repository at this point in the history
  • Loading branch information
kulaginds committed Jan 10, 2025
1 parent 9e24d31 commit a740170
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions register.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ func init() {

// RegisterDecompressor allows custom decompressors for a specified method ID.
func RegisterDecompressor(method []byte, dcomp Decompressor) {
if _, dup := decompressors.LoadOrStore(string(method), dcomp); dup {
panic("decompressor already registered")
}
decompressors.Store(string(method), dcomp)
}

func decompressor(method []byte) Decompressor {
Expand Down

0 comments on commit a740170

Please sign in to comment.