summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_nametree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc/cpdf_nametree.cpp')
-rw-r--r--core/fpdfdoc/cpdf_nametree.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/fpdfdoc/cpdf_nametree.cpp b/core/fpdfdoc/cpdf_nametree.cpp
index 04cb1b9e40..f30a27c681 100644
--- a/core/fpdfdoc/cpdf_nametree.cpp
+++ b/core/fpdfdoc/cpdf_nametree.cpp
@@ -43,14 +43,14 @@ CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode,
for (size_t i = 0; i < dwCount; i++) {
CFX_WideString csValue = pNames->GetUnicodeTextAt(i * 2);
int32_t iCompare = csValue.Compare(csName);
- if (iCompare <= 0) {
- if (ppFind)
- *ppFind = pNames;
- if (iCompare < 0)
- continue;
- } else {
+ if (iCompare > 0)
break;
- }
+
+ if (ppFind)
+ *ppFind = pNames;
+ if (iCompare < 0)
+ continue;
+
nIndex += i;
return pNames->GetDirectObjectAt(i * 2 + 1);
}
@@ -170,7 +170,7 @@ int CPDF_NameTree::GetIndex(const CFX_WideString& csName) const {
CPDF_Object* CPDF_NameTree::LookupValueAndName(int nIndex,
CFX_WideString* csName) const {
- *csName = CFX_WideString();
+ csName->clear();
if (!m_pRoot)
return nullptr;