summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-21 20:55:07 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-21 20:55:07 +0000
commit4d5c1c96366637604b1900f462804dc427bbe403 (patch)
tree2d0699e7718909bfb4f6c198e35c310433b70799 /core/fxcodec/jbig2
parent7af775a00379e84c0da1ab81695583eb7daaec3a (diff)
downloadpdfium-4d5c1c96366637604b1900f462804dc427bbe403.tar.xz
Avoid copying some big vectors in JBIG2_SymbolDict
Change-Id: I662f65b53a1a17be0062c92452d82acbbe157477 Reviewed-on: https://pdfium-review.googlesource.com/40910 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2')
-rw-r--r--core/fxcodec/jbig2/JBig2_Context.cpp4
-rw-r--r--core/fxcodec/jbig2/JBig2_SymbolDict.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp
index d976abdf31..d019cc148e 100644
--- a/core/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/fxcodec/jbig2/JBig2_Context.cpp
@@ -603,9 +603,9 @@ JBig2_Result CJBig2_Context::ParseSymbolDict(CJBig2_Segment* pSegment) {
}
if (wFlags & 0x0200) {
if (bUseGbContext)
- pSegment->m_SymbolDict->SetGbContext(gbContext);
+ pSegment->m_SymbolDict->SetGbContext(std::move(gbContext));
if (bUseGrContext)
- pSegment->m_SymbolDict->SetGrContext(grContext);
+ pSegment->m_SymbolDict->SetGrContext(std::move(grContext));
}
return JBig2_Result::kSuccess;
}
diff --git a/core/fxcodec/jbig2/JBig2_SymbolDict.h b/core/fxcodec/jbig2/JBig2_SymbolDict.h
index 83c419637a..956c83b12f 100644
--- a/core/fxcodec/jbig2/JBig2_SymbolDict.h
+++ b/core/fxcodec/jbig2/JBig2_SymbolDict.h
@@ -32,11 +32,11 @@ class CJBig2_SymbolDict {
const std::vector<JBig2ArithCtx>& GbContext() const { return m_gbContext; }
const std::vector<JBig2ArithCtx>& GrContext() const { return m_grContext; }
- void SetGbContext(const std::vector<JBig2ArithCtx>& gbContext) {
- m_gbContext = gbContext;
+ void SetGbContext(std::vector<JBig2ArithCtx> gbContext) {
+ m_gbContext = std::move(gbContext);
}
- void SetGrContext(const std::vector<JBig2ArithCtx>& grContext) {
- m_grContext = grContext;
+ void SetGrContext(std::vector<JBig2ArithCtx> grContext) {
+ m_grContext = std::move(grContext);
}
private: