From cc77739c6de6d50ad1c1d3ef7c30c69a6e2fc2d9 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 31 Dec 2024 10:07:29 +0900 Subject: [PATCH] Base: Expanded FindAttribute() to get rid of frequent constant transcode --- src/Base/Parameter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Base/Parameter.cpp b/src/Base/Parameter.cpp index bce28a56e1..3e02aae6e6 100644 --- a/src/Base/Parameter.cpp +++ b/src/Base/Parameter.cpp @@ -1411,9 +1411,10 @@ ParameterGrp::FindElement(XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* Start, if (clChild->getNodeType() == DOMNode::ELEMENT_NODE) { // the right node Type if (!XMLString::compareString(xType.unicodeForm(), clChild->getNodeName())) { - if (clChild->getAttributes()->getLength() > 0) { + auto attrs = clChild->getAttributes(); + if (attrs->getLength() > 0) { if (Name) { - DOMNode* attr = FindAttribute(clChild, "Name"); + DOMNode* attr = attrs->getNamedItem(XStrLiteral("Name").unicodeForm()); if (attr && !XMLString::compareString(xName.unicodeForm(), attr->getNodeValue())) {