PerformScan: Use nlohmann::json::is_{string,array}() for type checks
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I7f632623fa589147dcc72f5e8483e48251f8a60e
diff --git a/src/PerformScan.cpp b/src/PerformScan.cpp
index 7799596..b22ada7 100644
--- a/src/PerformScan.cpp
+++ b/src/PerformScan.cpp
@@ -301,17 +301,17 @@
static bool extractExposeActionRecordNames(std::vector<std::string>& matches,
nlohmann::json::iterator& keyPair)
{
- if (keyPair.value().type() == nlohmann::json::value_t::string)
+ if (keyPair.value().is_string())
{
matches.emplace_back(keyPair.value());
return true;
}
- if (keyPair.value().type() == nlohmann::json::value_t::array)
+ if (keyPair.value().is_array())
{
for (const auto& value : keyPair.value())
{
- if (value.type() != nlohmann::json::value_t::string)
+ if (!value.is_string())
{
std::cerr << "Value is invalid type " << value << "\n";
break;