From 1808114203adbaf7f5a5b4ec1793dc9d7e3e3406 Mon Sep 17 00:00:00 2001 From: Pedro Maciel Date: Sat, 23 Nov 2024 00:48:52 +0000 Subject: [PATCH] NetCDF Codec fix (wrong logic) --- src/mir/netcdf/Codec.cc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/mir/netcdf/Codec.cc b/src/mir/netcdf/Codec.cc index 7defdee81..a6f01fde1 100644 --- a/src/mir/netcdf/Codec.cc +++ b/src/mir/netcdf/Codec.cc @@ -168,22 +168,10 @@ Codec* CodecFactory::build(const std::string& name, const Variable& variable) { Log::debug() << "CodecFactory: looking for '" << name << "'" << std::endl; - if (auto j = m->find(name); j == m->end()) { + if (auto j = m->find(name); j != m->end()) { return j->second->make(variable); } - auto trim = [](const std::string& str, const std::string& trimmable) -> std::string { - size_t first = str.find_first_not_of(trimmable); - size_t last = str.find_last_not_of(trimmable); - - return first == std::string::npos || last == 0 ? "" : str.substr(first, last - first + 1); - }; - - if (auto name_trimmed = trim(name, " \t\n\r\f\v"); name_trimmed != name) { - Log::warning() << "CodecFactory: looking for (trimmed) '" << name << "'" << std::endl; - return build(name_trimmed, variable); - } - list(Log::error() << "CodecFactory: unknown '" << name << "', choices are: "); throw exception::SeriousBug("CodecFactory: unknown '" + name + "'"); }