Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.cpp

Issue 2897603003: Get and return String by const-ref if used as rvalue (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.cpp b/third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.cpp
index 27e7d347d8303b44284f99dede835d61327694fe..191b8e5fcefe1f8716b653b11beb9b88b7d3c8cf 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.cpp
@@ -36,18 +36,18 @@ DoubleOrString DoubleOrString::fromDouble(double value) {
return container;
}
-String DoubleOrString::getAsString() const {
+const String& DoubleOrString::getAsString() const {
DCHECK(isString());
return m_string;
}
-void DoubleOrString::setString(String value) {
+void DoubleOrString::setString(const String& value) {
DCHECK(isNull());
m_string = value;
m_type = SpecificTypeString;
}
-DoubleOrString DoubleOrString::fromString(String value) {
+DoubleOrString DoubleOrString::fromString(const String& value) {
DoubleOrString container;
container.setString(value);
return container;

Powered by Google App Engine
This is Rietveld 408576698