summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_array.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-09 11:04:41 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-09 18:33:56 +0000
commit59c1ac070d1c8ca70e96805b697c5635ccd70cdf (patch)
tree52ea762d0c694e241ed05f071e4295a47eb29007 /core/fpdfapi/parser/cpdf_array.h
parent7e2d1f4cb2af916e0d5eb01bb6b9cb3ffa0736c3 (diff)
downloadpdfium-59c1ac070d1c8ca70e96805b697c5635ccd70cdf.tar.xz
Simplify CPDF_Array::RemoveAt(index, size).
Instead of one general RemoveAt() method, split it into: - RemoveAt(index) - Truncate(nNewSize) - Clear() Update callers, which are now easier to understand. Update existing unit tests and add new tests. Change-Id: I38fe40146ce8f2479677b2caadd20a1756678768 Reviewed-on: https://pdfium-review.googlesource.com/6417 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_array.h')
-rw-r--r--core/fpdfapi/parser/cpdf_array.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/fpdfapi/parser/cpdf_array.h b/core/fpdfapi/parser/cpdf_array.h
index aff65d1454..bb17c0a427 100644
--- a/core/fpdfapi/parser/cpdf_array.h
+++ b/core/fpdfapi/parser/cpdf_array.h
@@ -99,7 +99,9 @@ class CPDF_Array : public CPDF_Object {
index, pdfium::MakeUnique<T>(m_pPool, std::forward<Args>(args)...)));
}
- void RemoveAt(size_t index, size_t nCount = 1);
+ void RemoveAt(size_t index);
+ void Clear();
+ void Truncate(size_t nNewSize);
void ConvertToIndirectObjectAt(size_t index, CPDF_IndirectObjectHolder* pDoc);
const_iterator begin() const { return m_Objects.begin(); }