diff options
Diffstat (limited to 'src/compressor/Compressor.cc')
-rw-r--r-- | src/compressor/Compressor.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compressor/Compressor.cc b/src/compressor/Compressor.cc index e6faae164f1..fa0f052f69b 100644 --- a/src/compressor/Compressor.cc +++ b/src/compressor/Compressor.cc @@ -24,6 +24,8 @@ #include "common/debug.h" #include "common/dout.h" +namespace TOPNSPC { + const char* Compressor::get_comp_alg_name(int a) { auto p = std::find_if(std::cbegin(compression_algorithms), std::cend(compression_algorithms), @@ -35,7 +37,8 @@ const char* Compressor::get_comp_alg_name(int a) { return p->first; } -boost::optional<Compressor::CompressionAlgorithm> Compressor::get_comp_alg_type(const std::string &s) { +boost::optional<Compressor::CompressionAlgorithm> +Compressor::get_comp_alg_type(std::string_view s) { auto p = std::find_if(std::cbegin(compression_algorithms), std::cend(compression_algorithms), [&s](const auto& kv) { return kv.first == s; }); @@ -54,7 +57,8 @@ const char *Compressor::get_comp_mode_name(int m) { default: return "???"; } } -boost::optional<Compressor::CompressionMode> Compressor::get_comp_mode_type(const std::string &s) { +boost::optional<Compressor::CompressionMode> +Compressor::get_comp_mode_type(std::string_view s) { if (s == "force") return COMP_FORCE; if (s == "aggressive") @@ -100,3 +104,5 @@ CompressorRef Compressor::create(CephContext *cct, int alg) std::string type_name = get_comp_alg_name(alg); return create(cct, type_name); } + +} // namespace TOPNSPC |