replace stoi with StringTo<int>

This commit is contained in:
Erik Frojdh
2020-03-19 12:33:13 +01:00
parent 272a8bfaf1
commit dee0aea378
4 changed files with 126 additions and 126 deletions

View File

@@ -922,7 +922,7 @@ int Module::getThresholdEnergy() {
std::string result = getAdditionalJsonParameter("threshold");
// convert to integer
try {
return stoi(result);
return std::stoi(result);
}
// not found or cannot scan integer
catch (...) {
@@ -2139,7 +2139,7 @@ std::string Module::setAdditionalJsonParameter(const std::string &key,
std::string valueLiteral(value);
// add quotations to value only if it is a string
try {
stoi(valueLiteral);
std::stoi(valueLiteral);
} catch (...) {
// add quotations if it failed to convert to integer, otherwise nothing
valueLiteral.insert(0, "\"");