From 0f33107efc9307f2e5988699d25400e305d28d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 17 Oct 2018 17:25:36 +0200 Subject: [PATCH] Math: no need to de-inline such tiny functions. --- src/Magnum/Math/Range.h | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index baaabf432..52c7c3c7e 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -204,7 +204,9 @@ template class Range { * remains the same. * @see @ref padded() */ - Range translated(const VectorType& vector) const; + Range translated(const VectorType& vector) const { + return {_min + vector, _max + vector}; + } /** * @brief Padded rage @@ -213,7 +215,9 @@ template class Range { * Center remains the same. * @see @ref translated(), @ref fromCenter() */ - Range padded(const VectorType& padding) const; + Range padded(const VectorType& padding) const { + return {_min - padding, _max + padding}; + } /** * @brief Scaled range @@ -221,7 +225,9 @@ template class Range { * Multiplies the minimal and maximal coordinates by given amount. * @see @ref padded() */ - Range scaled(const VectorType& scaling) const; + Range scaled(const VectorType& scaling) const { + return {_min*scaling, _max*scaling}; + } /** * @brief Whether given point is contained inside the range @@ -702,18 +708,6 @@ extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utili extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<3, Double>&); #endif -template Range Range::translated(const VectorType& vector) const { - return {_min + vector, _max + vector}; -} - -template Range Range::padded(const VectorType& padding) const { - return {_min - padding, _max + padding}; -} - -template Range Range::scaled(const VectorType& scaling) const { - return {_min*scaling, _max*scaling}; -} - }} namespace Corrade { namespace Utility {