Get rid of single-line if statements
Change-Id: I2b603563c650e83354af95ee6fb2fb4c9134fe86
diff --git a/src/ast_path.cpp b/src/ast_path.cpp
index f107cca..44c98c3 100644
--- a/src/ast_path.cpp
+++ b/src/ast_path.cpp
@@ -171,8 +171,9 @@
bool schemaPath_::operator==(const schemaPath_& b) const
{
- if (this->m_nodes.size() != b.m_nodes.size())
+ if (this->m_nodes.size() != b.m_nodes.size()) {
return false;
+ }
return this->m_nodes == b.m_nodes;
}
@@ -188,8 +189,9 @@
bool dataPath_::operator==(const dataPath_& b) const
{
- if (this->m_nodes.size() != b.m_nodes.size())
+ if (this->m_nodes.size() != b.m_nodes.size()) {
return false;
+ }
return this->m_nodes == b.m_nodes;
}
@@ -255,10 +257,11 @@
}
for (const auto& it : path.m_nodes) {
- if (it.m_prefix)
+ if (it.m_prefix) {
res = joinPaths(res, it.m_prefix.value().m_name + ":" + std::visit(nodeToDataStringVisitor(), it.m_suffix));
- else
+ } else {
res = joinPaths(res, (prefixes == Prefixes::Always ? path.m_nodes.at(0).m_prefix.value().m_name + ":" : "") + std::visit(nodeToDataStringVisitor(), it.m_suffix));
+ }
}
return res;
@@ -272,10 +275,11 @@
}
for (const auto& it : path.m_nodes) {
- if (it.m_prefix)
+ if (it.m_prefix) {
res = joinPaths(res, it.m_prefix.value().m_name + ":" + std::visit(nodeToSchemaStringVisitor(), it.m_suffix));
- else
+ } else {
res = joinPaths(res, (prefixes == Prefixes::Always ? path.m_nodes.at(0).m_prefix.value().m_name + ":" : "") + std::visit(nodeToSchemaStringVisitor(), it.m_suffix));
+ }
}
return res;
}