summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-29 11:24:14 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-29 11:24:15 -0700
commitd5d07dcf59ddc6439f73382c6e0b9e6d1851000d (patch)
tree3430639a1c286570a60e946e1b850aeeedaaa05a /xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
parentcd1e9ff4f432cbc29ed279e6891fb7ddc2ea3734 (diff)
downloadpdfium-d5d07dcf59ddc6439f73382c6e0b9e6d1851000d.tar.xz
Replace CFX_PtrArray with typesafe CFX_ArrayTemplate, part 8
This also removes another hand-written bubblesort in favor of the std::sort() STL function. Review-Url: https://codereview.chromium.org/1937513002
Diffstat (limited to 'xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp')
-rw-r--r--xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
index 00bd7811d8..40e5fa6625 100644
--- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
+++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
@@ -79,10 +79,10 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array* toEncode,
std::unique_ptr<CBC_ReedSolomonGF256Poly> infoTemp(
info.MultiplyByMonomial(ecBytes, 1, e));
BC_EXCEPTION_CHECK_ReturnVoid(e);
- std::unique_ptr<CFX_PtrArray> temp(infoTemp->Divide(generator, e));
+ std::unique_ptr<CFX_ArrayTemplate<CBC_ReedSolomonGF256Poly*>> temp(
+ infoTemp->Divide(generator, e));
BC_EXCEPTION_CHECK_ReturnVoid(e);
- CBC_ReedSolomonGF256Poly* remainder =
- (CBC_ReedSolomonGF256Poly*)(temp->operator[](1));
+ CBC_ReedSolomonGF256Poly* remainder = (*temp)[1];
CFX_Int32Array* coefficients = remainder->GetCoefficients();
int32_t numZeroCoefficients = ecBytes - coefficients->GetSize();
for (int32_t i = 0; i < numZeroCoefficients; i++) {
@@ -93,7 +93,7 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array* toEncode,
coefficients->operator[](y);
}
for (int32_t k = 0; k < temp->GetSize(); k++) {
- delete (CBC_ReedSolomonGF256Poly*)(*temp)[k];
+ delete (*temp)[k];
}
}
CBC_ReedSolomonEncoder::~CBC_ReedSolomonEncoder() {