From f84083d174faf4814100b3e8fcc9170a8369f178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Wed, 20 Nov 2024 12:45:46 +0100 Subject: [PATCH] Clang tidy gives one error at a time --- src/Functions/FunctionBinaryArithmetic.h | 45 +++++++++++------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/src/Functions/FunctionBinaryArithmetic.h b/src/Functions/FunctionBinaryArithmetic.h index 64a0d19a6b9..91adf73b679 100644 --- a/src/Functions/FunctionBinaryArithmetic.h +++ b/src/Functions/FunctionBinaryArithmetic.h @@ -76,30 +76,6 @@ namespace ErrorCodes extern const int SIZES_OF_ARRAYS_DONT_MATCH; } -namespace -{ -template typename DecimalType> -inline auto decimalResultType(const DecimalType & tx, const DecimalType & ty) -{ - const auto result_trait = DecimalUtils::binaryOpResult(tx, ty); - return DecimalType(result_trait.precision, result_trait.scale); -} - -template typename DecimalType> -inline DecimalType decimalResultType(const DecimalType & tx, const DataTypeNumber & ty) -{ - const auto result_trait = DecimalUtils::binaryOpResult(tx, ty); - return DecimalType(result_trait.precision, result_trait.scale); -} - -template typename DecimalType> -inline DecimalType decimalResultType(const DataTypeNumber & tx, const DecimalType & ty) -{ - const auto result_trait = DecimalUtils::binaryOpResult(tx, ty); - return DecimalType(result_trait.precision, result_trait.scale); -} -} - namespace traits_ { struct InvalidType; /// Used to indicate undefined operation @@ -256,6 +232,27 @@ public: namespace impl_ { +template typename DecimalType> +inline auto decimalResultType(const DecimalType & tx, const DecimalType & ty) +{ + const auto result_trait = DecimalUtils::binaryOpResult(tx, ty); + return DecimalType(result_trait.precision, result_trait.scale); +} + +template typename DecimalType> +inline DecimalType decimalResultType(const DecimalType & tx, const DataTypeNumber & ty) +{ + const auto result_trait = DecimalUtils::binaryOpResult(tx, ty); + return DecimalType(result_trait.precision, result_trait.scale); +} + +template typename DecimalType> +inline DecimalType decimalResultType(const DataTypeNumber & tx, const DecimalType & ty) +{ + const auto result_trait = DecimalUtils::binaryOpResult(tx, ty); + return DecimalType(result_trait.precision, result_trait.scale); +} + /** Arithmetic operations: +, -, *, /, %, * intDiv (integer division) * Bitwise operations: |, &, ^, ~.