From f3e3af606958855c9345dd3aba13e75f0b879193 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 3 Mar 2016 10:12:47 -0800 Subject: Fix O(n^2) behaviour in parser. Despite what the c++11 spec says, std::list::size() is still O(n), not O(1). R=dsinclair@chromium.org, ochang@chromium.org Review URL: https://codereview.chromium.org/1763443003 . --- core/include/fpdfapi/fpdf_page.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/include') diff --git a/core/include/fpdfapi/fpdf_page.h b/core/include/fpdfapi/fpdf_page.h index 4c880525f1..7c27340525 100644 --- a/core/include/fpdfapi/fpdf_page.h +++ b/core/include/fpdfapi/fpdf_page.h @@ -7,7 +7,7 @@ #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ #define CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ -#include +#include #include #include "core/include/fpdfapi/fpdf_parser.h" @@ -27,9 +27,9 @@ class CPDF_ImageObject; #define PDFTRANS_ISOLATED 0x0200 #define PDFTRANS_KNOCKOUT 0x0400 -class CPDF_PageObjectList : public std::list> { +class CPDF_PageObjectList + : public std::deque> { public: - // Linear complexity, to be avoided except as needed by public APIs. CPDF_PageObject* GetPageObjectByIndex(int index); }; -- cgit v1.2.3