From 91de54e098b179f033deb1ee61fc3d7d5997f588 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 4 Feb 2025 21:46:42 +0200 Subject: [PATCH] Remove redundant if-statement in Index_prefix_calc::get_avg_frequency the code went like this: for ( ... ; i < prefixes ; ...) { if (i < prefixes) { ... --- sql/sql_statistics.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 51a13fc54a7..163cb8da9fc 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -2077,12 +2077,9 @@ public: for (i= 0, state= calc_state; i < prefixes; i++, state++) { - if (i < prefixes) - { - double val= state->prefix_count == 0 ? - 0 : (double) state->entry_count / state->prefix_count; - index_info->collected_stats->set_avg_frequency(i, val); - } + double val= state->prefix_count == 0 ? + 0 : (double) state->entry_count / state->prefix_count; + index_info->collected_stats->set_avg_frequency(i, val); } } };