diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-05-25 20:12:39 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-25 20:12:39 +0000 |
commit | d4d645abecec0fe2e6477b5928cfa2967675585b (patch) | |
tree | a130cf0a76265c359e4fd1331213c836fe7066e7 /.gn | |
parent | 710fa99b0bd26e6761c4481b4b9b6d26d2954c3e (diff) | |
download | pdfium-d4d645abecec0fe2e6477b5928cfa2967675585b.tar.xz |
Reserve space for code words when creating encoder context
During encoding, the code is going to walk through every character in
m_msg and determine what values need to be added to m_codewords. The
ceiling on the number of characters being added to m_codewords is the
length of m_msg, so reserving enought space in advance. This prevents
thrash related to incrementing the string and thus resizing in a tight
loop.
BUG=chromium:846027
Change-Id: Icefd6955933f8068feeeee6243e430f60c50d747
Reviewed-on: https://pdfium-review.googlesource.com/32990
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to '.gn')
0 files changed, 0 insertions, 0 deletions