aboutsummaryrefslogtreecommitdiffstats
path: root/fxbarcode
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2019-01-29 00:05:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2019-01-29 00:05:50 +0000
commit408e5d3565804d9752bf47ac64fb6d4d636d8aec (patch)
tree24fe0b28e085b5019a8ec5fe616f180d976bc388 /fxbarcode
parenta482e1f9802d49b720923a5cbd99ef1bb3d75da8 (diff)
downloadplatform_external_pdfium-408e5d3565804d9752bf47ac64fb6d4d636d8aec.tar.gz
platform_external_pdfium-408e5d3565804d9752bf47ac64fb6d4d636d8aec.tar.bz2
platform_external_pdfium-408e5d3565804d9752bf47ac64fb6d4d636d8aec.zip
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>
Diffstat (limited to 'fxbarcode')
-rw-r--r--fxbarcode/oned/BC_OneDimWriter.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp
index 29fab7b5e..861f8d278 100644
--- a/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -276,6 +276,7 @@ bool CBC_OneDimWriter::RenderResult(WideStringView contents,
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)