From d9f363475079eaf38e0b5fdf4f081e0e8803e2a0 Mon Sep 17 00:00:00 2001 From: ZXShady <153229951+ZXShady@users.noreply.github.com> Date: Tue, 8 Oct 2024 02:07:04 +0100 Subject: [PATCH] Remove unnecessary trailing return types The lamdba can deduce the return type correctly having it deducing it automaticly makes less rooms for mistakes later when we change the impl. --- include/SFML/Graphics/Color.inl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/SFML/Graphics/Color.inl b/include/SFML/Graphics/Color.inl index 4be7fb2b7..fd486d649 100644 --- a/include/SFML/Graphics/Color.inl +++ b/include/SFML/Graphics/Color.inl @@ -74,7 +74,7 @@ constexpr bool operator!=(Color left, Color right) //////////////////////////////////////////////////////////// constexpr Color operator+(Color left, Color right) { - const auto clampedAdd = [](std::uint8_t lhs, std::uint8_t rhs) -> std::uint8_t + const auto clampedAdd = [](std::uint8_t lhs, std::uint8_t rhs) { const int intResult = int{lhs} + int{rhs}; return static_cast(intResult < 255 ? intResult : 255); @@ -90,7 +90,7 @@ constexpr Color operator+(Color left, Color right) //////////////////////////////////////////////////////////// constexpr Color operator-(Color left, Color right) { - const auto clampedSub = [](std::uint8_t lhs, std::uint8_t rhs) -> std::uint8_t + const auto clampedSub = [](std::uint8_t lhs, std::uint8_t rhs) { const int intResult = int{lhs} - int{rhs}; return static_cast(intResult > 0 ? intResult : 0); @@ -106,7 +106,7 @@ constexpr Color operator-(Color left, Color right) //////////////////////////////////////////////////////////// constexpr Color operator*(Color left, Color right) { - const auto scaledMul = [](std::uint8_t lhs, std::uint8_t rhs) -> std::uint8_t + const auto scaledMul = [](std::uint8_t lhs, std::uint8_t rhs) { const auto uint16Result = static_cast(std::uint16_t{lhs} * std::uint16_t{rhs}); return static_cast(uint16Result / 255u);