| commit | 408e5d3565804d9752bf47ac64fb6d4d636d8aec | [log] [tgz] |
|---|---|---|
| author | Lei Zhang <thestig@chromium.org> | Tue Jan 29 00:05:50 2019 +0000 |
| committer | Chromium commit bot <commit-bot@chromium.org> | Tue Jan 29 00:05:50 2019 +0000 |
| tree | 24fe0b28e085b5019a8ec5fe616f180d976bc388 | |
| parent | a482e1f9802d49b720923a5cbd99ef1bb3d75da8 [diff] |
Speed up CBC_OneDimWriter::RenderResult(). Reserve space for all the appends to |CBC_OneDimWriter::m_output|. BUG=chromium:925415 Change-Id: I5a944ba0ec74127270906ca432148df076855f6d Reviewed-on: https://pdfium-review.googlesource.com/c/49110 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp index 29fab7b..861f8d2 100644 --- a/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -276,6 +276,7 @@ m_barWidth = m_Width; m_output.clear(); + m_output.reserve(codeOldLength * m_multiple); for (int32_t inputX = 0, outputX = leftPadding * m_multiple; inputX < codeOldLength; ++inputX, outputX += m_multiple) { if (code[inputX] != 1)