From 62c97dea24ee83bf88a078712de34165a81dc828 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Fri, 22 Dec 2017 22:05:32 -0500 Subject: [PATCH] compressor: Use unqualified encode/decode This is a portion of the namespace project. Signed-off-by: Adam C. Emerson --- src/compressor/lz4/LZ4Compressor.h | 12 ++++++------ src/compressor/zstd/ZstdCompressor.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compressor/lz4/LZ4Compressor.h b/src/compressor/lz4/LZ4Compressor.h index 3ab96e23332..a990808b96a 100644 --- a/src/compressor/lz4/LZ4Compressor.h +++ b/src/compressor/lz4/LZ4Compressor.h @@ -40,7 +40,7 @@ class LZ4Compressor : public Compressor { unsigned num = src.get_num_buffers(); uint32_t origin_len; int compressed_len; - ::encode((uint32_t)num, dst); + encode((uint32_t)num, dst); while (left) { origin_len = p.get_ptr_and_advance(left, &data); compressed_len = LZ4_compress_fast_continue( @@ -50,8 +50,8 @@ class LZ4Compressor : public Compressor { return -1; pos += compressed_len; left -= origin_len; - ::encode(origin_len, dst); - ::encode((uint32_t)compressed_len, dst); + encode(origin_len, dst); + encode((uint32_t)compressed_len, dst); } assert(p.end()); @@ -69,12 +69,12 @@ class LZ4Compressor : public Compressor { bufferlist &dst) override { uint32_t count; std::vector > compressed_pairs; - ::decode(count, p); + decode(count, p); compressed_pairs.resize(count); uint32_t total_origin = 0; for (unsigned i = 0; i < count; ++i) { - ::decode(compressed_pairs[i].first, p); - ::decode(compressed_pairs[i].second, p); + decode(compressed_pairs[i].first, p); + decode(compressed_pairs[i].second, p); total_origin += compressed_pairs[i].first; } compressed_len -= (sizeof(uint32_t) + sizeof(uint32_t) * count * 2); diff --git a/src/compressor/zstd/ZstdCompressor.h b/src/compressor/zstd/ZstdCompressor.h index 4df4193edc4..82bb2f9d52f 100644 --- a/src/compressor/zstd/ZstdCompressor.h +++ b/src/compressor/zstd/ZstdCompressor.h @@ -58,7 +58,7 @@ class ZstdCompressor : public Compressor { ZSTD_freeCStream(s); // prefix with decompressed length - ::encode((uint32_t)src.length(), dst); + encode((uint32_t)src.length(), dst); dst.append(outptr, 0, outbuf.pos); return 0; } @@ -76,7 +76,7 @@ class ZstdCompressor : public Compressor { } compressed_len -= 4; uint32_t dst_len; - ::decode(dst_len, p); + decode(dst_len, p); bufferptr dstptr(dst_len); ZSTD_outBuffer_s outbuf;