summaryrefslogtreecommitdiffstats
path: root/src/util/math.h
diff options
context:
space:
mode:
authorUwe Klotz <uwe_klotz@web.de>2014-11-12 10:35:58 +0100
committerUwe Klotz <uwe_klotz@web.de>2014-11-15 19:42:51 +0100
commitf56be466481f38305576b3f5365c8a88394dd5fd (patch)
treeddd569fc92456173d7509f13086a0c155d4cef48 /src/util/math.h
parentd6597ebaeadf55e548bb64185cb9cf32c40233e4 (diff)
Use pass-by-value for math types
Diffstat (limited to 'src/util/math.h')
-rw-r--r--src/util/math.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/math.h b/src/util/math.h
index aeec6ed72b..1ea352b048 100644
--- a/src/util/math.h
+++ b/src/util/math.h
@@ -17,7 +17,7 @@ using std::fabs;
#define math_max3(a, b, c) math_max(math_max((a), (b)), (c))
template <typename T>
-inline T math_clamp(const T& value, const T& min, const T& max) {
+inline T math_clamp(T value, T min, T max) {
// XXX: If max < min, behavior is undefined, and has been causing problems.
// if debugging is on, assert when this happens.
if (max < min) {
@@ -37,7 +37,7 @@ inline T math_clamp(const T& value, const T& min, const T& max) {
// hack this to support floating point values! The programmer should be required
// to manually convert so they are aware of the conversion.
template <typename T>
-inline bool even(const T& value) {
+inline bool even(T value) {
return value % 2 == 0;
}