From 0fcd00cb5b0705373bf613f6b2588c9482ed48be Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Tue, 31 Oct 2017 20:18:14 -0700 Subject: [PATCH] Get rid of some pointless copying. --- src/mathfu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mathfu.h b/src/mathfu.h index a49f687..f5e3617 100644 --- a/src/mathfu.h +++ b/src/mathfu.h @@ -33,7 +33,7 @@ struct Bounds initialized = false; } - void AddPoint(mathfu::Vector p) { + void AddPoint(const mathfu::Vector &p) { if (initialized) { for (int ii = 0; ii < d; ii ++) { min(ii) = std::min(min(ii), p(ii)); @@ -58,7 +58,7 @@ typedef mathfu::Matrix Mat4f; typedef mathfu::Quaternion Quatf; typedef Bounds Boundsf; -template static inline std::vector toStdVec(mathfu::Vector vec) +template static inline std::vector toStdVec(const mathfu::Vector &vec) { std::vector result(d); for (int ii = 0; ii < d; ii ++) { @@ -67,7 +67,7 @@ template static inline std::vector toStdVec(mathfu::Vector std::vector toStdVec(mathfu::Quaternion quat) { +template std::vector toStdVec(const mathfu::Quaternion &quat) { return std::vector { quat.vector()[0], quat.vector()[1], quat.vector()[2], quat.scalar() }; }