summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/doc_utils.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-14 14:54:57 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-14 14:54:57 -0700
commitff242e0b62173718a6e98aee1306ac48f6372572 (patch)
treeee6e92036ea2d7b7d5525e0dc236e6f31a221eb6 /core/fpdfdoc/doc_utils.cpp
parent8e4c505ff6d82263183e9f812fcc7b45c1414f15 (diff)
downloadpdfium-ff242e0b62173718a6e98aee1306ac48f6372572.tar.xz
Avoid needless construction of CFX_ByteStrings during string building
There are perfectly fine operators for adding to an existing string without first duplicating the arguments. Review URL: https://codereview.chromium.org/1891953002
Diffstat (limited to 'core/fpdfdoc/doc_utils.cpp')
-rw-r--r--core/fpdfdoc/doc_utils.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/core/fpdfdoc/doc_utils.cpp b/core/fpdfdoc/doc_utils.cpp
index ccb244d87c..408f0065e2 100644
--- a/core/fpdfdoc/doc_utils.cpp
+++ b/core/fpdfdoc/doc_utils.cpp
@@ -91,11 +91,11 @@ CFX_ByteString CPDF_DefaultAppearance::GetFontString() {
}
CPDF_SimpleParser syntax(m_csDA.AsStringC());
if (syntax.FindTagParamFromStart("Tf", 2)) {
- csFont += (CFX_ByteString)syntax.GetWord();
+ csFont += syntax.GetWord();
csFont += " ";
- csFont += (CFX_ByteString)syntax.GetWord();
+ csFont += syntax.GetWord();
csFont += " ";
- csFont += (CFX_ByteString)syntax.GetWord();
+ csFont += syntax.GetWord();
}
return csFont;
}
@@ -135,31 +135,31 @@ CFX_ByteString CPDF_DefaultAppearance::GetColorString(
}
CPDF_SimpleParser syntax(m_csDA.AsStringC());
if (syntax.FindTagParamFromStart(bStrokingOperation ? "G" : "g", 1)) {
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
return csColor;
}
if (syntax.FindTagParamFromStart(bStrokingOperation ? "RG" : "rg", 3)) {
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
return csColor;
}
if (syntax.FindTagParamFromStart(bStrokingOperation ? "K" : "k", 4)) {
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += syntax.GetWord();
}
return csColor;
}
@@ -245,10 +245,10 @@ CFX_ByteString CPDF_DefaultAppearance::GetTextMatrixString() {
CPDF_SimpleParser syntax(m_csDA.AsStringC());
if (syntax.FindTagParamFromStart("Tm", 6)) {
for (int i = 0; i < 6; i++) {
- csTM += (CFX_ByteString)syntax.GetWord();
+ csTM += syntax.GetWord();
csTM += " ";
}
- csTM += (CFX_ByteString)syntax.GetWord();
+ csTM += syntax.GetWord();
}
return csTM;
}