diff options
author | tsepez <tsepez@chromium.org> | 2016-12-14 05:57:10 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-14 05:57:10 -0800 |
commit | a9caab94c1f16929e5acf2676117224617d80f53 (patch) | |
tree | d71ff9a82fae6e6080deb76375f43056127b3ee2 /xfa/fxbarcode/BC_TwoDimWriter.cpp | |
parent | 992ecf7c189e5cabf43e5ad862511cf63d030966 (diff) | |
download | pdfium-a9caab94c1f16929e5acf2676117224617d80f53.tar.xz |
Avoid the ptr.reset(new XXX()) anti-pattern
Be suspicious of |new|. This removes some of the
easy cases.
Review-Url: https://codereview.chromium.org/2571913002
Diffstat (limited to 'xfa/fxbarcode/BC_TwoDimWriter.cpp')
-rw-r--r-- | xfa/fxbarcode/BC_TwoDimWriter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xfa/fxbarcode/BC_TwoDimWriter.cpp b/xfa/fxbarcode/BC_TwoDimWriter.cpp index ec6c3626b2..84678a81da 100644 --- a/xfa/fxbarcode/BC_TwoDimWriter.cpp +++ b/xfa/fxbarcode/BC_TwoDimWriter.cpp @@ -10,6 +10,7 @@ #include "core/fxge/cfx_pathdata.h" #include "core/fxge/cfx_renderdevice.h" #include "third_party/base/numerics/safe_math.h" +#include "third_party/base/ptr_util.h" #include "xfa/fxbarcode/BC_TwoDimWriter.h" #include "xfa/fxbarcode/BC_Writer.h" #include "xfa/fxbarcode/common/BC_CommonBitMatrix.h" @@ -134,7 +135,7 @@ void CBC_TwoDimWriter::RenderResult(uint8_t* code, if (topPadding < 0) { topPadding = 0; } - m_output.reset(new CBC_CommonBitMatrix); + m_output = pdfium::MakeUnique<CBC_CommonBitMatrix>(); m_output->Init(outputWidth, outputHeight); for (int32_t inputY = 0, outputY = topPadding; (inputY < inputHeight) && (outputY < outputHeight - multiY); |