summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 301fca8969..77707624d2 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -462,13 +462,7 @@ void CPDF_FormObject::CalcBoundingBox() {
CPDF_PageObject* CPDF_PageObjectList::GetPageObjectByIndex(int index) {
if (index < 0 || index >= pdfium::CollectionSize<int>(*this))
return nullptr;
- int current = 0;
- for (const auto& pObj : *this) {
- if (index == current)
- return pObj.get();
- ++current;
- }
- return nullptr;
+ return (*this)[index].get();
}
CPDF_PageObjectHolder::CPDF_PageObjectHolder()