[#1523] blobstor: Unify fstree and blobovnicza interfaces

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-07-08 10:09:48 +03:00 committed by fyrchik
parent 5aa3defc67
commit 266458fe5c
21 changed files with 157 additions and 183 deletions

View file

@ -83,10 +83,10 @@ func (c *CConfig) Decompress(data []byte) ([]byte, error) {
// Compress compresses data if compression is enabled
// and returns data untouched otherwise.
func (c *CConfig) Compress(data []byte) []byte {
if c.Enabled {
return c.encoder.EncodeAll(data, make([]byte, 0, len(data)))
if c == nil || !c.Enabled {
return data
}
return data
return c.encoder.EncodeAll(data, make([]byte, 0, len(data)))
}
// Close closes encoder and decoder, returns any error occured.