From 9c292fef316739f43730f11b9a2b6d3e4b725b54 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 21 Jun 2018 15:02:24 +0000 Subject: Avoid const-refs to implicitly constructed strings. Because the invisible temporary goes out of scope at the next semicolon. Also avoid returning const string references since the cost is low to properly keep the string alive. Change-Id: Id283e4fd99f79a02d79d739a533a4ce05e831e2a Reviewed-on: https://pdfium-review.googlesource.com/35710 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fpdfapi/render/cpdf_dibsource.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi/render') diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp index 98a2dda999..72dec67438 100644 --- a/core/fpdfapi/render/cpdf_dibsource.cpp +++ b/core/fpdfapi/render/cpdf_dibsource.cpp @@ -288,8 +288,7 @@ CPDF_DIBSource::LoadState CPDF_DIBSource::ContinueLoadDIBSource( if (m_Status == LoadState::kFail) return LoadState::kFail; - const ByteString& decoder = m_pStreamAcc->GetImageDecoder(); - if (decoder == "JPXDecode") + if (m_pStreamAcc->GetImageDecoder() == "JPXDecode") return LoadState::kFail; FXCODEC_STATUS iDecodeStatus; @@ -448,7 +447,7 @@ bool CPDF_DIBSource::GetDecodeAndMaskArray(bool* bDefaultDecode, } CPDF_DIBSource::LoadState CPDF_DIBSource::CreateDecoder() { - const ByteString& decoder = m_pStreamAcc->GetImageDecoder(); + ByteString decoder = m_pStreamAcc->GetImageDecoder(); if (decoder.IsEmpty()) return LoadState::kSuccess; -- cgit v1.2.3