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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.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/StringOrDouble.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp b/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp
index 84e48d576ada2d4595132dac4fa2f980abecffcb..f9f5dbc3b1865ceed12bfdac8689443d9eb84411 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp
@@ -36,18 +36,18 @@ StringOrDouble StringOrDouble::fromDouble(double value) {
return container;
}
-String StringOrDouble::getAsString() const {
+const String& StringOrDouble::getAsString() const {
DCHECK(isString());
return m_string;
}
-void StringOrDouble::setString(String value) {
+void StringOrDouble::setString(const String& value) {
DCHECK(isNull());
m_string = value;
m_type = SpecificTypeString;
}
-StringOrDouble StringOrDouble::fromString(String value) {
+StringOrDouble StringOrDouble::fromString(const String& value) {
StringOrDouble container;
container.setString(value);
return container;

Powered by Google App Engine
This is Rietveld 408576698