Fix nits from commit 67ccef7.

Change-Id: I24b191ecfe8b65a7d0ddc4958dc117de9ed9ae83
Reviewed-on: https://pdfium-review.googlesource.com/8630
Reviewed-by: Jane Liu <janeliulwq@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfdoc/cpdf_nametree.cpp b/core/fpdfdoc/cpdf_nametree.cpp
index 04cb1b9..f30a27c 100644
--- a/core/fpdfdoc/cpdf_nametree.cpp
+++ b/core/fpdfdoc/cpdf_nametree.cpp
@@ -43,14 +43,14 @@
     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 @@
 
 CPDF_Object* CPDF_NameTree::LookupValueAndName(int nIndex,
                                                CFX_WideString* csName) const {
-  *csName = CFX_WideString();
+  csName->clear();
   if (!m_pRoot)
     return nullptr;
 
diff --git a/core/fpdfdoc/cpdf_nametree_unittest.cpp b/core/fpdfdoc/cpdf_nametree_unittest.cpp
index 28af9e0..bffb496 100644
--- a/core/fpdfdoc/cpdf_nametree_unittest.cpp
+++ b/core/fpdfdoc/cpdf_nametree_unittest.cpp
@@ -16,8 +16,9 @@
 
   // Add the key "1" (with BOM) and value 100 into the array.
   std::ostringstream buf;
-  buf << static_cast<unsigned char>(254) << static_cast<unsigned char>(255)
-      << static_cast<unsigned char>(0) << static_cast<unsigned char>(49);
+  constexpr char kData[] = "\xFE\xFF\x00\x31";
+  for (size_t i = 0; i < sizeof(kData); ++i)
+    buf.put(kData[i]);
   pNames->AddNew<CPDF_String>(CFX_ByteString(buf), true);
   pNames->AddNew<CPDF_Number>(100);
 
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 7dbaf7f..f8823c9 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -1397,7 +1397,6 @@
     return nullptr;
 
   CPDF_Object* pDestObj = nullptr;
-  CFX_ByteString bsName;
   CFX_WideString wsName;
   CPDF_NameTree nameTree(pDoc, "Dests");
   int count = nameTree.GetCount();
@@ -1413,6 +1412,7 @@
 
     index -= count;
     int i = 0;
+    CFX_ByteString bsName;
     for (const auto& it : *pDest) {
       bsName = it.first;
       pDestObj = it.second.get();