Skip to content

Commit 886d740

Browse files
committed
Optimized max_part_bit in sql_select.cc to use my_find_first_bit.
1 parent f0b2e76 commit 886d740

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sql/sql_select.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6967,12 +6967,13 @@ Item_equal::add_key_fields(JOIN *join, KEY_FIELD **key_fields,
69676967
}
69686968

69696969

6970-
static uint
6970+
static inline uint
69716971
max_part_bit(key_part_map bits)
69726972
{
6973-
uint found;
6974-
for (found=0; bits & 1 ; found++,bits>>=1) ;
6975-
return found;
6973+
if (bits == 0)
6974+
return 0;
6975+
/* find first zero bit by reverting all bits and find first bit */
6976+
return my_find_first_bit(~(ulonglong) bits);
69766977
}
69776978

69786979

0 commit comments

Comments
 (0)