Replace CFX_DSPATemplate with std::binary_search.

This CL replaces the last instance of CFX_DSPATemplate with std::binary_search.

Review-Url: https://codereview.chromium.org/2007443003
diff --git a/BUILD.gn b/BUILD.gn
index e4ab941..ee5aad5 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -950,7 +950,6 @@
       "xfa/fde/xml/fde_xml.h",
       "xfa/fde/xml/fde_xml_imp.cpp",
       "xfa/fde/xml/fde_xml_imp.h",
-      "xfa/fgas/crt/fgas_algorithm.h",
       "xfa/fgas/crt/fgas_codepage.cpp",
       "xfa/fgas/crt/fgas_codepage.h",
       "xfa/fgas/crt/fgas_language.h",
diff --git a/xfa.gyp b/xfa.gyp
index 43b5e41..0ff3d39 100644
--- a/xfa.gyp
+++ b/xfa.gyp
@@ -93,7 +93,6 @@
         "xfa/fde/xml/fde_xml.h",
         "xfa/fde/xml/fde_xml_imp.cpp",
         "xfa/fde/xml/fde_xml_imp.h",
-        "xfa/fgas/crt/fgas_algorithm.h",
         "xfa/fgas/crt/fgas_codepage.cpp",
         "xfa/fgas/crt/fgas_codepage.h",
         "xfa/fgas/crt/fgas_language.h",
diff --git a/xfa/fde/css/fde_cssdatatable.cpp b/xfa/fde/css/fde_cssdatatable.cpp
index 4399053..1af0059 100644
--- a/xfa/fde/css/fde_cssdatatable.cpp
+++ b/xfa/fde/css/fde_cssdatatable.cpp
@@ -7,7 +7,6 @@
 #include "xfa/fde/css/fde_cssdatatable.h"
 
 #include "core/fxcrt/include/fx_ext.h"
-#include "xfa/fgas/crt/fgas_algorithm.h"
 #include "xfa/fgas/crt/fgas_codepage.h"
 #include "xfa/fgas/crt/fgas_system.h"
 
diff --git a/xfa/fgas/crt/fgas_algorithm.h b/xfa/fgas/crt/fgas_algorithm.h
deleted file mode 100644
index f68b53f..0000000
--- a/xfa/fgas/crt/fgas_algorithm.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FGAS_CRT_FGAS_ALGORITHM_H_
-#define XFA_FGAS_CRT_FGAS_ALGORITHM_H_
-
-#include <cstdint>
-
-#include "core/fxcrt/include/fx_basic.h"
-
-template <class baseType>
-class CFX_DSPATemplate {
- public:
-  int32_t Lookup(const baseType& find, const baseType* pArray, int32_t iCount) {
-    ASSERT(pArray);
-    if (iCount < 1)
-      return -1;
-
-    int32_t iStart = 0, iEnd = iCount - 1, iMid;
-    do {
-      iMid = (iStart + iEnd) / 2;
-      const baseType& v = pArray[iMid];
-      if (find == v)
-        return iMid;
-      if (find < v)
-        iEnd = iMid - 1;
-      else
-        iStart = iMid + 1;
-    } while (iStart <= iEnd);
-    return -1;
-  }
-};
-
-#endif  // XFA_FGAS_CRT_FGAS_ALGORITHM_H_
diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp
index a382d83..fe72e29 100644
--- a/xfa/fxfa/app/xfa_textlayout.cpp
+++ b/xfa/fxfa/app/xfa_textlayout.cpp
@@ -15,7 +15,6 @@
 #include "xfa/fde/fde_gedevice.h"
 #include "xfa/fde/fde_object.h"
 #include "xfa/fde/xml/fde_xml_imp.h"
-#include "xfa/fgas/crt/fgas_algorithm.h"
 #include "xfa/fgas/crt/fgas_codepage.h"
 #include "xfa/fxfa/app/xfa_ffwidgetacc.h"
 #include "xfa/fxfa/include/xfa_ffapp.h"
diff --git a/xfa/fxfa/parser/xfa_basic_imp.cpp b/xfa/fxfa/parser/xfa_basic_imp.cpp
index 759d530..8f53b57 100644
--- a/xfa/fxfa/parser/xfa_basic_imp.cpp
+++ b/xfa/fxfa/parser/xfa_basic_imp.cpp
@@ -7,7 +7,6 @@
 #include "xfa/fxfa/parser/xfa_basic_imp.h"
 
 #include "core/fxcrt/include/fx_ext.h"
-#include "xfa/fgas/crt/fgas_algorithm.h"
 #include "xfa/fgas/crt/fgas_codepage.h"
 #include "xfa/fgas/crt/fgas_system.h"
 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h"
@@ -215,24 +214,23 @@
   iCount = pElement->wCount;
   return g_XFAElementAttributeData + pElement->wStart;
 }
+
 const XFA_ATTRIBUTEINFO* XFA_GetAttributeOfElement(XFA_ELEMENT eElement,
                                                    XFA_ATTRIBUTE eAttribute,
                                                    uint32_t dwPacket) {
   int32_t iCount = 0;
   const uint8_t* pAttr = XFA_GetElementAttributes(eElement, iCount);
-  if (pAttr == NULL || iCount < 1) {
-    return NULL;
-  }
-  CFX_DSPATemplate<uint8_t> search;
-  int32_t index = search.Lookup(eAttribute, pAttr, iCount);
-  if (index < 0) {
-    return NULL;
-  }
+  if (!pAttr || iCount < 1)
+    return nullptr;
+
+  if (!std::binary_search(pAttr, pAttr + iCount, eAttribute))
+    return nullptr;
+
   const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttribute);
   ASSERT(pInfo);
   if (dwPacket == XFA_XDPPACKET_UNKNOWN)
     return pInfo;
-  return (dwPacket & pInfo->dwPackets) ? pInfo : NULL;
+  return (dwPacket & pInfo->dwPackets) ? pInfo : nullptr;
 }
 
 const XFA_PROPERTY* XFA_GetElementProperties(XFA_ELEMENT eElement,