mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Add likely/unlikely to speed up execution
Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
This commit is contained in:
@@ -393,7 +393,7 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
|
||||
(*tables)->reginfo.lock_type <= TL_READ_NO_INSERT))
|
||||
lock_type=F_RDLCK;
|
||||
|
||||
if ((error=(*tables)->file->ha_external_lock(thd,lock_type)))
|
||||
if (unlikely((error=(*tables)->file->ha_external_lock(thd,lock_type))))
|
||||
{
|
||||
(*tables)->file->print_error(error, MYF(0));
|
||||
while (--i)
|
||||
@@ -439,7 +439,7 @@ void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock, bool free_lock)
|
||||
DBUG_ASSERT(!(sql_lock->flags & GET_LOCK_ON_THD));
|
||||
my_free(sql_lock);
|
||||
}
|
||||
if (!errors)
|
||||
if (likely(!errors))
|
||||
thd->clear_error();
|
||||
THD_STAGE_INFO(thd, org_stage);
|
||||
DBUG_VOID_RETURN;
|
||||
@@ -726,7 +726,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
|
||||
if ((*table)->current_lock != F_UNLCK)
|
||||
{
|
||||
(*table)->current_lock = F_UNLCK;
|
||||
if ((error=(*table)->file->ha_external_lock(thd, F_UNLCK)))
|
||||
if (unlikely((error=(*table)->file->ha_external_lock(thd, F_UNLCK))))
|
||||
{
|
||||
error_code= error;
|
||||
(*table)->file->print_error(error, MYF(0));
|
||||
|
||||
Reference in New Issue
Block a user