summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-11-20 10:05:12 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-11-20 10:05:12 +0000
commitbbfdba2465db7cc8d7ef0b44bc0d4fd5d152036b (patch)
treeabe95cfe0d23f38c7286ac140c34279a2673d9db
parent58596788da2e3fc0afac6ea8f3de0b3af6ce1c32 (diff)
atoi => std::from_chars
-rw-r--r--searchlib/src/vespa/searchlib/fef/indexproperties.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
index 9b111c4bd5d..9267913d275 100644
--- a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
+++ b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
@@ -4,6 +4,7 @@
#include "properties.h"
#include <vespa/vespalib/locale/c.h>
#include <limits>
+#include <charconv>
namespace search::fef::indexproperties {
@@ -49,10 +50,12 @@ uint32_t
lookupUint32(const Properties &props, const vespalib::string &name, uint32_t defaultValue)
{
Property p = props.lookup(name);
+ uint32_t value(defaultValue);
if (p.found()) {
- return atoi(p.get().c_str());
+ const auto & s = p.get();
+ std::from_chars(s.c_str(), s.c_str() + s.size(), value);
}
- return defaultValue;
+ return value;
}
bool