From 1c14ae2fbe1ae95dac3a7f5e60d049d9630aef02 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 3 Jul 2018 15:57:03 +0000 Subject: 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 Reviewed-by: Lei Zhang --- fxbarcode/datamatrix/BC_DataMatrixWriter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fxbarcode/datamatrix/BC_DataMatrixWriter.cpp') 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 encodeLowLevel( ASSERT(height); auto matrix = pdfium::MakeUnique(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; } -- cgit v1.2.3