From 2ad228e8ff3ad7050c58d563879b9831c688e2f1 Mon Sep 17 00:00:00 2001 From: halcanary Date: Wed, 8 Apr 2015 08:40:36 -0700 Subject: [PATCH] SkPDF: Remove Array's unused set(i) and get(i) (leaving only append()) BUG=skia:3585 Review URL: https://codereview.chromium.org/1071583003 --- src/pdf/SkPDFTypes.cpp | 8 -------- src/pdf/SkPDFTypes.h | 12 ------------ tests/PDFPrimitivesTest.cpp | 5 +---- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp index 89d6a0b..cd130cf 100644 --- a/src/pdf/SkPDFTypes.cpp +++ b/src/pdf/SkPDFTypes.cpp @@ -255,14 +255,6 @@ void SkPDFArray::reserve(int length) { fValue.setReserve(length); } -SkPDFObject* SkPDFArray::setAt(int offset, SkPDFObject* value) { - SkASSERT(offset < fValue.count()); - value->ref(); - fValue[offset]->unref(); - fValue[offset] = value; - return value; -} - SkPDFObject* SkPDFArray::append(SkPDFObject* value) { SkASSERT(fValue.count() < kMaxLen); value->ref(); diff --git a/src/pdf/SkPDFTypes.h b/src/pdf/SkPDFTypes.h index dca96e4..76e1911 100644 --- a/src/pdf/SkPDFTypes.h +++ b/src/pdf/SkPDFTypes.h @@ -250,18 +250,6 @@ public: */ void reserve(int length); - /** Returns the object at the given offset in the array. - * @param index The index into the array to retrieve. - */ - SkPDFObject* getAt(int index) { return fValue[index]; } - - /** Set the object at the given offset in the array. Ref's value. - * @param index The index into the array to set. - * @param value The value to add to the array. - * @return The value argument is returned. - */ - SkPDFObject* setAt(int index, SkPDFObject* value); - /** Append the object to the end of the array and increments its ref count. * @param value The value to add to the array. * @return The value argument is returned. diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp index a98aacb..99bf7ac 100644 --- a/tests/PDFPrimitivesTest.cpp +++ b/tests/PDFPrimitivesTest.cpp @@ -269,9 +269,6 @@ DEF_TEST(PDFPrimitives, reporter) { SkAutoTUnref int0(new SkPDFInt(0)); array->append(int0.get()); SimpleCheckObjectOutput(reporter, array.get(), "[42 0.5 0]"); - SkAutoTUnref int1(new SkPDFInt(1)); - array->setAt(0, int1.get()); - SimpleCheckObjectOutput(reporter, array.get(), "[1 0.5 0]"); SkAutoTUnref dict(new SkPDFDict); SimpleCheckObjectOutput(reporter, dict.get(), "<<>>"); @@ -283,7 +280,7 @@ DEF_TEST(PDFPrimitives, reporter) { dict->insert(n2.get(), realHalf.get()); dict->insert(n3.get(), array.get()); SimpleCheckObjectOutput(reporter, dict.get(), - "<>"); + "<>"); TestPDFStream(reporter); -- 2.7.4