Inline GetMarkParamPairAtIndex into FPDFPageObjMark_GetParamKey.

Bug: pdfium:1037
Change-Id: Iddc0d51874cf22d24ddf634ff767cd08807a4904
Reviewed-on: https://pdfium-review.googlesource.com/37630
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index 2ace03c..4df5505 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -109,22 +109,6 @@
   return pMarkItem->GetParam();
 }
 
-const std::pair<const ByteString, std::unique_ptr<CPDF_Object>>*
-GetMarkParamPairAtIndex(FPDF_PAGEOBJECTMARK mark, unsigned long index) {
-  const CPDF_Dictionary* pParams = GetMarkParamDict(mark);
-  if (!pParams)
-    return nullptr;
-
-  for (auto& it : *pParams) {
-    if (index == 0)
-      return &it;
-
-    --index;
-  }
-
-  return nullptr;
-}
-
 CPDF_Dictionary* GetOrCreateMarkParamsDict(FPDF_DOCUMENT document,
                                            FPDF_PAGEOBJECTMARK mark) {
   CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
@@ -367,12 +351,19 @@
                             unsigned long index,
                             void* buffer,
                             unsigned long buflen) {
-  auto* param_pair = GetMarkParamPairAtIndex(mark, index);
-  if (!param_pair)
+  const CPDF_Dictionary* pParams = GetMarkParamDict(mark);
+  if (!pParams)
     return 0;
 
-  return Utf16EncodeMaybeCopyAndReturnLength(
-      WideString::FromUTF8(param_pair->first.AsStringView()), buffer, buflen);
+  for (auto& it : *pParams) {
+    if (index == 0) {
+      return Utf16EncodeMaybeCopyAndReturnLength(
+          WideString::FromUTF8(it.first.AsStringView()), buffer, buflen);
+    }
+    --index;
+  }
+
+  return 0;
 }
 
 FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV