Browse Source

replaceWithSmaller and replaceWithLarger takes source by constant reference.

David Piuva 1 year ago
parent
commit
a6ba9e13f4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/DFPSR/math/scalar.h

+ 2 - 2
Source/DFPSR/math/scalar.h

@@ -106,7 +106,7 @@ inline void swap(T &a, T &b) {
 
 // More compact than min(a, b) when reading from the target
 template <typename T>
-inline void replaceWithSmaller(T& target, T source) {
+inline void replaceWithSmaller(T &target, const T &source) {
 	if (source < target) {
 		target = source;
 	}
@@ -114,7 +114,7 @@ inline void replaceWithSmaller(T& target, T source) {
 
 // More compact than max(a, b) when reading from the target
 template <typename T>
-inline void replaceWithLarger(T& target, T source) {
+inline void replaceWithLarger(T &target, const T &source) {
 	if (source > target) {
 		target = source;
 	}