Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit ac0d98d

Browse files
committed
A few more shortenings
1 parent 9afa8f1 commit ac0d98d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

System/Vector.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,30 +368,30 @@ namespace RTE {
368368
/// <param name="lhs">A Vector reference as the left hand side operand.</param>
369369
/// <param name="rhs">A Vector reference as the right hand side operand.</param>
370370
/// <returns>The resulting Vector.</returns>
371-
friend Vector operator+(const Vector &lhs, const Vector &rhs) { Vector returnVector(lhs.m_X + rhs.m_X, lhs.m_Y + rhs.m_Y); return returnVector; }
371+
friend Vector operator+(const Vector &lhs, const Vector &rhs) { return Vector(lhs.m_X + rhs.m_X, lhs.m_Y + rhs.m_Y); }
372372

373373
/// <summary>
374374
/// Subtraction operator overload for Vectors.
375375
/// </summary>
376376
/// <param name="lhs">A Vector reference as the left hand side operand.</param>
377377
/// <param name="rhs">A Vector reference as the right hand side operand.</param>
378378
/// <returns>The resulting Vector.</returns>
379-
friend Vector operator-(const Vector &lhs, const Vector &rhs) { Vector returnVector(lhs.m_X - rhs.m_X, lhs.m_Y - rhs.m_Y); return returnVector; }
379+
friend Vector operator-(const Vector &lhs, const Vector &rhs) { return Vector(lhs.m_X - rhs.m_X, lhs.m_Y - rhs.m_Y); }
380380

381381
/// <summary>
382382
/// Multiplication operator overload for a Vector and a float.
383383
/// </summary>
384384
/// <param name="rhs">A float reference as the right hand side operand.</param>
385385
/// <returns>The resulting Vector.</returns>
386-
Vector operator*(const float &rhs) const { Vector returnVector(m_X * rhs, m_Y * rhs); return returnVector; }
386+
Vector operator*(const float &rhs) const { return Vector(m_X * rhs, m_Y * rhs); }
387387

388388
/// <summary>
389389
/// Multiplication operator overload for Vectors.
390390
/// </summary>
391391
/// <param name="lhs">A Vector reference as the left hand side operand.</param>
392392
/// <param name="rhs">A Vector reference as the right hand side operand.</param>
393393
/// <returns>The resulting Vector.</returns>
394-
friend Vector operator*(const Vector &lhs, const Vector &rhs) { Vector returnVector(lhs.m_X * rhs.m_X, lhs.m_Y * rhs.m_Y); return returnVector; }
394+
friend Vector operator*(const Vector &lhs, const Vector &rhs) { return Vector(lhs.m_X * rhs.m_X, lhs.m_Y * rhs.m_Y); }
395395

396396
/// <summary>
397397
/// Division operator overload for a Vector and a float.

0 commit comments

Comments
 (0)