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

Unified Diff: Source/platform/LengthPoint.h

Issue 305883002: Switch arguments to const Length references for performance (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « Source/platform/LengthBox.h ('k') | Source/platform/LengthSize.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/LengthPoint.h
diff --git a/Source/platform/LengthPoint.h b/Source/platform/LengthPoint.h
index 75497a1dcc3447a9f6d0598f6e67c4ef7eb9cc6d..c9677a863951bb111a0883b05d5ccf9e7365094c 100644
--- a/Source/platform/LengthPoint.h
+++ b/Source/platform/LengthPoint.h
@@ -40,7 +40,7 @@ public:
{
}
- LengthPoint(Length x, Length y)
+ LengthPoint(const Length& x, const Length& y)
: m_x(x)
, m_y(y)
{
@@ -49,11 +49,11 @@ public:
bool operator==(const LengthPoint& o) const { return m_x == o.m_x && m_y == o.m_y; }
bool operator!=(const LengthPoint& o) const { return m_x != o.m_x || m_y != o.m_y; }
- void setX(Length x) { m_x = x; }
- Length x() const { return m_x; }
+ void setX(const Length& x) { m_x = x; }
+ const Length& x() const { return m_x; }
- void setY(Length y) { m_y = y; }
- Length y() const { return m_y; }
+ void setY(const Length& y) { m_y = y; }
+ const Length& y() const { return m_y; }
private:
Length m_x;
« no previous file with comments | « Source/platform/LengthBox.h ('k') | Source/platform/LengthSize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698