From 4dc8c50f81bd78711bcfb432629800b8683102b6 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 14 Sep 2018 18:00:54 +0000 Subject: Make ContentParam::m_Name be a ByteString. Currently this is an inline fixed-length char[] buffer. We make a byte string out of this in many places, and the current implementation still memcpy's, so the additional costs should be minimal. Next, we can avoid special-casing names that are longer than the fixed size. Change-Id: I980463cbb2325a9d6080bb51a6dfb0dbd1b704b1 Reviewed-on: https://pdfium-review.googlesource.com/42430 Reviewed-by: Henrique Nakashima Commit-Queue: Tom Sepez --- core/fpdfapi/page/cpdf_streamcontentparser.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.h') diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h index 6417043305..d9239fd6fa 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.h +++ b/core/fpdfapi/page/cpdf_streamcontentparser.h @@ -71,12 +71,9 @@ class CPDF_StreamContentParser { ~ContentParam(); Type m_Type; - std::unique_ptr m_pObject; FX_Number m_Number; - struct { - int m_Len; - char m_Buffer[32]; - } m_Name; + ByteString m_Name; + std::unique_ptr m_pObject; }; static const int kParamBufSize = 16; -- cgit v1.2.3