summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmlnode.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-16 19:25:30 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-16 19:25:30 +0000
commit9d7c7ff0a5f0da6e7574557e5a8e82b9b5b7c1ae (patch)
treea9559fdcd8e24951985968cc9f8c32c6f8da1b5d /core/fxcrt/xml/cfx_xmlnode.cpp
parent7d75650672a848428aaadb603b2814d33dfb479f (diff)
downloadpdfium-9d7c7ff0a5f0da6e7574557e5a8e82b9b5b7c1ae.tar.xz
Make more variables const-ref.chromium/3373
Found by ClangTidy. BUG=pdfium:1040 Change-Id: I6d7cb26ae2d12f5650f73596d0b991234b076f57 Reviewed-on: https://pdfium-review.googlesource.com/28712 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/xml/cfx_xmlnode.cpp')
-rw-r--r--core/fxcrt/xml/cfx_xmlnode.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/core/fxcrt/xml/cfx_xmlnode.cpp b/core/fxcrt/xml/cfx_xmlnode.cpp
index 1851a4d81e..5e787ed2b9 100644
--- a/core/fxcrt/xml/cfx_xmlnode.cpp
+++ b/core/fxcrt/xml/cfx_xmlnode.cpp
@@ -110,16 +110,18 @@ std::unique_ptr<CFX_XMLNode> CFX_XMLNode::Clone() {
void CFX_XMLNode::Save(const RetainPtr<CFX_SeekableStreamProxy>& pXMLStream) {}
-WideString CFX_XMLNode::EncodeEntities(WideString value) {
- value.Replace(L"&", L"&amp;");
- value.Replace(L"<", L"&lt;");
- value.Replace(L">", L"&gt;");
- value.Replace(L"\'", L"&apos;");
- value.Replace(L"\"", L"&quot;");
- return value;
+WideString CFX_XMLNode::EncodeEntities(const WideString& value) {
+ WideString ret = value;
+ ret.Replace(L"&", L"&amp;");
+ ret.Replace(L"<", L"&lt;");
+ ret.Replace(L">", L"&gt;");
+ ret.Replace(L"\'", L"&apos;");
+ ret.Replace(L"\"", L"&quot;");
+ return ret;
}
-WideString CFX_XMLNode::AttributeToString(WideString name, WideString value) {
+WideString CFX_XMLNode::AttributeToString(const WideString& name,
+ const WideString& value) {
WideString ret = L" ";
ret += name;
ret += L"=\"";