Remove some special cases from FPDF_NameDecode().

We're converting from a stringview to a string, so there's going
to be an allocation and copy involved, and there isn't much
point in making a first pass to see which kind of copy we can use.

-- remove one other place where there's a pointless first pass.

Change-Id: Iab28eeb1e3e03596ed73a6520af29193b609eea7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/72330
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index e42f6ce..1ad817e 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -306,8 +306,7 @@
 void CPDF_StreamContentParser::AddNameParam(ByteStringView bsName) {
   ContentParam& param = m_ParamBuf[GetNextParamPos()];
   param.m_Type = ContentParam::NAME;
-  param.m_Name =
-      bsName.Contains('#') ? PDF_NameDecode(bsName) : ByteString(bsName);
+  param.m_Name = PDF_NameDecode(bsName);
 }
 
 void CPDF_StreamContentParser::AddNumberParam(ByteStringView str) {
diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp
index e6a7f61..196d1c9 100644
--- a/core/fpdfapi/parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp
@@ -91,9 +91,6 @@
 }
 
 ByteString PDF_NameDecode(ByteStringView orig) {
-  if (!orig.Contains('#'))
-    return ByteString(orig);
-
   size_t src_size = orig.GetLength();
   size_t out_index = 0;
   ByteString result;