Skip to content

clang-tidy: use range loops #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions libxml++/nodes/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ Tvector find_common(const xmlpp::ustring& xpath,

if (namespaces)
{
for (xmlpp::Node::PrefixNsMap::const_iterator it = namespaces->begin();
it != namespaces->end(); ++it)
for (const auto& [prefix, ns_uri] : *namespaces)
xmlXPathRegisterNs(ctxt,
reinterpret_cast<const xmlChar*>(it->first.c_str()),
reinterpret_cast<const xmlChar*>(it->second.c_str()));
reinterpret_cast<const xmlChar*>(prefix.c_str()),
reinterpret_cast<const xmlChar*>(ns_uri.c_str()));
}

auto result = xmlXPathEval((const xmlChar*)xpath.c_str(), ctxt);
Expand Down Expand Up @@ -140,11 +139,10 @@ xmlXPathObject* eval_common(const xmlpp::ustring& xpath,

if (namespaces)
{
for (xmlpp::Node::PrefixNsMap::const_iterator it = namespaces->begin();
it != namespaces->end(); ++it)
for (const auto& [prefix, ns_uri] : *namespaces)
xmlXPathRegisterNs(ctxt,
reinterpret_cast<const xmlChar*>(it->first.c_str()),
reinterpret_cast<const xmlChar*>(it->second.c_str()));
reinterpret_cast<const xmlChar*>(prefix.c_str()),
reinterpret_cast<const xmlChar*>(ns_uri.c_str()));
}

auto xpath_value = xmlXPathEvalExpression(
Expand Down