summaryrefslogtreecommitdiff
path: root/fxbarcode/datamatrix/BC_HighLevelEncoder.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-09-11 19:19:32 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-11 19:19:32 +0000
commit5c86fd4c5110a99606316721786f1ba9bf0d855a (patch)
tree8494b7ff5d1ce649359c87b792605550487bfdf9 /fxbarcode/datamatrix/BC_HighLevelEncoder.h
parent7a45d5722c7e75bfd9c53b0a2ba1e42a2fcc9626 (diff)
downloadpdfium-chromium/3550.tar.xz
Small optimizations for CBC_HighLevelEncoder::lookAheadTestchromium/3550
Currently ClusterFuzz is timing out when running cases that cause a large number of calls to this method. Looking at the cases, I believe these to be valid calls, so this CL attempts to lower the cost of making each individual call. Adds in pre-allocation of a vector that has a fixed size and uses a const-ref for passing in |msg| to avoid copying. BUG=chromium:881678 Change-Id: I61ec4dc96e79c84def5b10102cc58a96773ce07f Reviewed-on: https://pdfium-review.googlesource.com/42230 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fxbarcode/datamatrix/BC_HighLevelEncoder.h')
-rw-r--r--fxbarcode/datamatrix/BC_HighLevelEncoder.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/fxbarcode/datamatrix/BC_HighLevelEncoder.h
index 50cfc8c592..9ad0d705be 100644
--- a/fxbarcode/datamatrix/BC_HighLevelEncoder.h
+++ b/fxbarcode/datamatrix/BC_HighLevelEncoder.h
@@ -29,7 +29,7 @@ class CBC_HighLevelEncoder {
WideString ecLevel,
bool allowRectangular,
int32_t& e);
- static int32_t lookAheadTest(WideString msg,
+ static int32_t lookAheadTest(const WideString& msg,
int32_t startpos,
int32_t currentMode);
static bool isDigit(wchar_t ch);