diff --git a/fpdfsdk/cpdfsdk_annotiterator.cpp b/fpdfsdk/cpdfsdk_annotiterator.cpp
index 58ec083..326624b 100644
--- a/fpdfsdk/cpdfsdk_annotiterator.cpp
+++ b/fpdfsdk/cpdfsdk_annotiterator.cpp
@@ -14,7 +14,9 @@
 #include "fpdfsdk/cpdfsdk_annot.h"
 #include "fpdfsdk/cpdfsdk_pageview.h"
 #include "fpdfsdk/cpdfsdk_widget.h"
+#include "third_party/base/containers/adapters.h"
 #include "third_party/base/containers/contains.h"
+#include "third_party/base/containers/span.h"
 
 namespace {
 
@@ -80,23 +82,25 @@
 }
 
 CFX_FloatRect CPDFSDK_AnnotIterator::AddToAnnotsList(
-    std::vector<UnownedPtr<CPDFSDK_Annot>>* sa,
+    std::vector<UnownedPtr<CPDFSDK_Annot>>& sa,
     size_t idx) {
-  CPDFSDK_Annot* pLeftTopAnnot = sa->at(idx);
+  CPDFSDK_Annot* pLeftTopAnnot = sa[idx];
   CFX_FloatRect rcLeftTop = GetAnnotRect(pLeftTopAnnot);
   m_Annots.emplace_back(pLeftTopAnnot);
-  sa->erase(sa->begin() + idx);
+  sa.erase(sa.begin() + idx);
   return rcLeftTop;
 }
 
 void CPDFSDK_AnnotIterator::AddSelectedToAnnots(
-    std::vector<UnownedPtr<CPDFSDK_Annot>>* sa,
-    std::vector<size_t>* aSelect) {
-  for (size_t i = 0; i < aSelect->size(); ++i)
-    m_Annots.emplace_back(sa->at(aSelect->at(i)));
+    std::vector<UnownedPtr<CPDFSDK_Annot>>& sa,
+    pdfium::span<const size_t> aSelect) {
+  for (size_t select_idx : aSelect) {
+    m_Annots.emplace_back(sa[select_idx]);
+  }
 
-  for (size_t i = aSelect->size(); i > 0; --i)
-    sa->erase(sa->begin() + aSelect->at(i - 1));
+  for (size_t select_idx : pdfium::base::Reversed(aSelect)) {
+    sa.erase(sa.begin() + select_idx);
+  }
 }
 
 // static
@@ -105,19 +109,19 @@
   CPDF_Page* pPDFPage = pPageView->GetPDFPage();
   ByteString sTabs = pPDFPage->GetDict()->GetByteStringFor("Tabs");
   if (sTabs == "R")
-    return kRow;
+    return TabOrder::kRow;
   if (sTabs == "C")
-    return kColumn;
-  return kStructure;
+    return TabOrder::kColumn;
+  return TabOrder::kStructure;
 }
 
 void CPDFSDK_AnnotIterator::GenerateResults() {
   switch (m_eTabOrder) {
-    case kStructure:
+    case TabOrder::kStructure:
       CollectAnnots(&m_Annots);
       break;
 
-    case kRow: {
+    case TabOrder::kRow: {
       std::vector<UnownedPtr<CPDFSDK_Annot>> sa;
       CollectAnnots(&sa);
       std::sort(sa.begin(), sa.end(), CompareByLeftAscending);
@@ -135,7 +139,7 @@
         if (nLeftTopIndex < 0)
           continue;
 
-        CFX_FloatRect rcLeftTop = AddToAnnotsList(&sa, nLeftTopIndex);
+        CFX_FloatRect rcLeftTop = AddToAnnotsList(sa, nLeftTopIndex);
 
         std::vector<size_t> aSelect;
         for (size_t i = 0; i < sa.size(); ++i) {
@@ -144,12 +148,12 @@
           if (fCenterY > rcLeftTop.bottom && fCenterY < rcLeftTop.top)
             aSelect.push_back(i);
         }
-        AddSelectedToAnnots(&sa, &aSelect);
+        AddSelectedToAnnots(sa, aSelect);
       }
       break;
     }
 
-    case kColumn: {
+    case TabOrder::kColumn: {
       std::vector<UnownedPtr<CPDFSDK_Annot>> sa;
       CollectAnnots(&sa);
       std::sort(sa.begin(), sa.end(), CompareByTopDescending);
@@ -170,7 +174,7 @@
         if (nLeftTopIndex < 0)
           continue;
 
-        CFX_FloatRect rcLeftTop = AddToAnnotsList(&sa, nLeftTopIndex);
+        CFX_FloatRect rcLeftTop = AddToAnnotsList(sa, nLeftTopIndex);
 
         std::vector<size_t> aSelect;
         for (size_t i = 0; i < sa.size(); ++i) {
@@ -179,7 +183,7 @@
           if (fCenterX > rcLeftTop.left && fCenterX < rcLeftTop.right)
             aSelect.push_back(i);
         }
-        AddSelectedToAnnots(&sa, &aSelect);
+        AddSelectedToAnnots(sa, aSelect);
       }
       break;
     }
diff --git a/fpdfsdk/cpdfsdk_annotiterator.h b/fpdfsdk/cpdfsdk_annotiterator.h
index 74f93a4..e1b2e13 100644
--- a/fpdfsdk/cpdfsdk_annotiterator.h
+++ b/fpdfsdk/cpdfsdk_annotiterator.h
@@ -12,6 +12,7 @@
 #include "core/fpdfdoc/cpdf_annot.h"
 #include "core/fxcrt/fx_coordinates.h"
 #include "core/fxcrt/unowned_ptr.h"
+#include "third_party/base/containers/span.h"
 
 class CPDFSDK_Annot;
 class CPDFSDK_PageView;
@@ -29,16 +30,16 @@
   CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot);
 
  private:
-  enum TabOrder : uint8_t { kStructure = 0, kRow, kColumn };
+  enum class TabOrder : uint8_t { kStructure = 0, kRow, kColumn };
 
   static TabOrder GetTabOrder(CPDFSDK_PageView* pPageView);
 
   void GenerateResults();
   void CollectAnnots(std::vector<UnownedPtr<CPDFSDK_Annot>>* pArray);
-  CFX_FloatRect AddToAnnotsList(std::vector<UnownedPtr<CPDFSDK_Annot>>* sa,
+  CFX_FloatRect AddToAnnotsList(std::vector<UnownedPtr<CPDFSDK_Annot>>& sa,
                                 size_t idx);
-  void AddSelectedToAnnots(std::vector<UnownedPtr<CPDFSDK_Annot>>* sa,
-                           std::vector<size_t>* aSelect);
+  void AddSelectedToAnnots(std::vector<UnownedPtr<CPDFSDK_Annot>>& sa,
+                           pdfium::span<const size_t> aSelect);
 
   UnownedPtr<CPDFSDK_PageView> const m_pPageView;
   const std::vector<CPDF_Annot::Subtype> m_subtypes;
