From: Danny Al-Gaaf Date: Mon, 14 May 2018 20:56:54 +0000 (+0200) Subject: compressor/lz4/LZ4Compressor.h: reduce scope of variables X-Git-Tag: v14.0.1~984^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=72a14df6cfcb653b2300b3173f4743e3d5dd74f5;p=ceph.git compressor/lz4/LZ4Compressor.h: reduce scope of variables Signed-off-by: Danny Al-Gaaf --- diff --git a/src/compressor/lz4/LZ4Compressor.h b/src/compressor/lz4/LZ4Compressor.h index 5ad5d31b7629..8f0f093249cc 100644 --- a/src/compressor/lz4/LZ4Compressor.h +++ b/src/compressor/lz4/LZ4Compressor.h @@ -50,12 +50,10 @@ class LZ4Compressor : public Compressor { int pos = 0; const char *data; unsigned num = src.get_num_buffers(); - uint32_t origin_len; - int compressed_len; encode((uint32_t)num, dst); while (left) { - origin_len = p.get_ptr_and_advance(left, &data); - compressed_len = LZ4_compress_fast_continue( + uint32_t origin_len = p.get_ptr_and_advance(left, &data); + int compressed_len = LZ4_compress_fast_continue( &lz4_stream, data, outptr.c_str()+pos, origin_len, outptr.length()-pos, 1); if (compressed_len <= 0)