summaryrefslogtreecommitdiff
path: root/fxbarcode/datamatrix
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-07-03 15:57:03 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-03 15:57:03 +0000
commit1c14ae2fbe1ae95dac3a7f5e60d049d9630aef02 (patch)
tree2d121ae2a0436adce5c54379d1824b427dd03359 /fxbarcode/datamatrix
parentd77e0ed72f73fb63305d04953ef03e2edab82d34 (diff)
downloadpdfium-1c14ae2fbe1ae95dac3a7f5e60d049d9630aef02.tar.xz
Avoid explicit allocs in fxbarcode matrix classes.
Other cleanups: Remove unused method. Fold Init() into constructor. Return span<> where possible. Change-Id: Ie38d32efb6e63d86ae24e93684903a6dd900810f Reviewed-on: https://pdfium-review.googlesource.com/36810 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxbarcode/datamatrix')
-rw-r--r--fxbarcode/datamatrix/BC_DataMatrixWriter.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp b/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp
index d4f9ad3479..799b7749ca 100644
--- a/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp
+++ b/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp
@@ -59,7 +59,6 @@ std::unique_ptr<CBC_CommonByteMatrix> encodeLowLevel(
ASSERT(height);
auto matrix = pdfium::MakeUnique<CBC_CommonByteMatrix>(width, height);
- matrix->Init();
int32_t matrixY = 0;
for (int32_t y = 0; y < symbolHeight; y++) {
int32_t matrixX;
@@ -144,6 +143,6 @@ uint8_t* CBC_DataMatrixWriter::Encode(const WideString& contents,
outWidth = bytematrix->GetWidth();
outHeight = bytematrix->GetHeight();
uint8_t* result = FX_Alloc2D(uint8_t, outWidth, outHeight);
- memcpy(result, bytematrix->GetArray(), outWidth * outHeight);
+ memcpy(result, bytematrix->GetArray().data(), outWidth * outHeight);
return result;
}