Skip to content

Commit

Permalink
Rectf::p1(): Return const Vector&
Browse files Browse the repository at this point in the history
There is no need to make a copy of `Rectf::m_p1`.
  • Loading branch information
Vankata453 committed Dec 5, 2024
1 parent c2b560b commit 3d7e630
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/math/rectf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Rectf final
// leave these two public to save the headaches of set/get functions for such
// simple things :)

inline Vector p1() const { return m_p1; }
inline const Vector& p1() const { return m_p1; }
inline Vector p2() const { return Vector(m_p1.x + m_size.width, m_p1.y + m_size.height); }

void set_p1(const Vector& p) {
Expand Down

0 comments on commit 3d7e630

Please sign in to comment.