diff --git a/six/modules/c++/cphd03/source/CPHDXMLControl.cpp b/six/modules/c++/cphd03/source/CPHDXMLControl.cpp index 38d3d35bc..1bda52ef8 100644 --- a/six/modules/c++/cphd03/source/CPHDXMLControl.cpp +++ b/six/modules/c++/cphd03/source/CPHDXMLControl.cpp @@ -778,8 +778,7 @@ void CPHDXMLControl::fromXML(const xml::lite::Element* srpXML, SRP& srp) #if ENFORCESPEC srp.srpType = cphd::SRPType(getFirstAndOnly(srpXML, "SRPType")->getCharacterData()); #else - std::string s(getFirstAndOnly(srpXML, "SRPType")->getCharacterData()); - str::upper(s); + const auto s = str::upper(getFirstAndOnly(srpXML, "SRPType")->getCharacterData()); srp.srpType = cphd::SRPType::toType(s); #endif parseInt(getFirstAndOnly(srpXML, "NumSRPs"), srp.numSRPs); diff --git a/six/modules/c++/samples/check_valid_six.cpp b/six/modules/c++/samples/check_valid_six.cpp index c1f7e6ea4..2f4bac8c6 100644 --- a/six/modules/c++/samples/check_valid_six.cpp +++ b/six/modules/c++/samples/check_valid_six.cpp @@ -189,7 +189,7 @@ static int main_(int argc, char** argv) const std::string inputPath(options->get("input")); std::vector inputPathnames = getPathnames(inputPath); const std::string logFile(options->get("log")); - std::string level(options->get("level")); + auto level = str::upper(options->get("level")); std::vector schemaPaths; getSchemaPaths(*options, "--schema", "schema", schemaPaths); @@ -200,7 +200,6 @@ static int main_(int argc, char** argv) xmlRegistry.addCreator(); xmlRegistry.addCreator(); - str::upper(level); str::trim(level); std::unique_ptr log = logging::setupLogger(fs::path(argv[0]).filename().string(), level, logFile); diff --git a/six/modules/c++/six.sicd/source/Grid.cpp b/six/modules/c++/six.sicd/source/Grid.cpp index 9f5577018..ea6805336 100644 --- a/six/modules/c++/six.sicd/source/Grid.cpp +++ b/six/modules/c++/six.sicd/source/Grid.cpp @@ -132,14 +132,13 @@ DirectionParameters::calculateWeightFunction() const return nullptr; } - std::string windowName(weightType->windowName); - str::upper(windowName); + const std::string windowName(weightType->windowName); - if (windowName == "UNIFORM") + if (str::eq(windowName, "UNIFORM")) { return std::make_unique(); } - if (windowName == "HAMMING") + if (str::eq(windowName, "HAMMING")) { double coef = 0.0; if (weightType->parameters.empty() || weightType->parameters[0].str().empty()) @@ -156,11 +155,11 @@ DirectionParameters::calculateWeightFunction() const return std::make_unique(coef); } - if (windowName == "HANNING") + if (str::eq(windowName, "HANNING")) { return std::make_unique(0.50); } - if (windowName == "KAISER") + if (str::eq(windowName, "KAISER")) { return std::make_unique(double(weightType->parameters[0])); } diff --git a/six/modules/c++/six.sicd/source/Utilities.cpp b/six/modules/c++/six.sicd/source/Utilities.cpp index 039c528c2..5dd9e3483 100644 --- a/six/modules/c++/six.sicd/source/Utilities.cpp +++ b/six/modules/c++/six.sicd/source/Utilities.cpp @@ -717,10 +717,8 @@ std::unique_ptr Utilities::getComplexData( const std::string& pathname, const std::vector& schemaPaths) { - std::string extension = fs::path(pathname).extension().string(); - str::lower(extension); - - if (extension == ".xml") + const auto extension = fs::path(pathname).extension().string(); + if (str::eq(extension, ".xml")) { logging::NullLogger log; return parseDataFromFile(pathname, schemaPaths, log); diff --git a/six/modules/c++/six/source/Utilities.cpp b/six/modules/c++/six/source/Utilities.cpp index 52d688375..ff04dd92c 100644 --- a/six/modules/c++/six/source/Utilities.cpp +++ b/six/modules/c++/six/source/Utilities.cpp @@ -96,10 +96,9 @@ BooleanType six::toType(const std::string& s) { std::string type(s); str::trim(type); - str::lower(type); - if (type == "true" || type == "1" || type == "yes") + if (str::eq(type, "true") || type == "1" || str::eq(type, "yes")) return BooleanType::IS_TRUE; - if (type == "false" || type == "0" || type == "no") + if (str::eq(type, "false") || type == "0" || str::eq(type, "no")) return BooleanType::IS_FALSE; return BooleanType::NOT_SET; }