From 58bb1ffecfca490e047bc8f521cda0dd41754bcf Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 24 Jan 2022 08:29:17 +0300 Subject: [PATCH] Shortcut --- src/AggregateFunctions/AggregateFunctionIf.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/AggregateFunctions/AggregateFunctionIf.cpp b/src/AggregateFunctions/AggregateFunctionIf.cpp index c102f20d6ca..5ba54ff8505 100644 --- a/src/AggregateFunctions/AggregateFunctionIf.cpp +++ b/src/AggregateFunctions/AggregateFunctionIf.cpp @@ -151,12 +151,16 @@ public: for (size_t i = 0; i < batch_size; ++i) final_nulls[i] = (!!null_map[i]) | (!filter_values[i]); - this->nested_function->addBatchSinglePlaceNotNull( - batch_size, this->nestedPlace(place), columns_param, final_nulls.get(), arena, -1); - if constexpr (result_is_nullable) + { if (!memoryIsByte(final_nulls.get(), batch_size, 1)) this->setFlag(place); + else + return; /// No work to do. + } + + this->nested_function->addBatchSinglePlaceNotNull( + batch_size, this->nestedPlace(place), columns_param, final_nulls.get(), arena, -1); } #if USE_EMBEDDED_COMPILER