martin-sucha commented on code in PR #1822:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1822#discussion_r1810116471


##########
compressor.go:
##########
@@ -32,6 +32,7 @@ type Compressor interface {
        Name() string
        Encode(data []byte) ([]byte, error)
        Decode(data []byte) ([]byte, error)
+       DecodeSized(data []byte, size uint32) ([]byte, error)

Review Comment:
   Could you please add doc comment describing the semantics of the method?
   
   <hr />
   
   We could also change this to be append-like, as follows:
   
   ```go
   // DecodeSized decodes the encoded bytes and appends them to dst.
   // decodeSize is the size of data after decompression.
   DecodeSized(dst, encoded []byte, decodedSize int32) ([]byte, error)
   ```
   
   It seems that would be more flexible, for example it would allow the framer 
to reuse buffers for decompression in a sync.Pool if needed. And since this 
will be in 2.0, we could adjust the other methods as well.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to