diff options
author | Monty <monty@mariadb.org> | 2018-04-04 12:16:12 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-05-07 00:07:32 +0300 |
commit | 30ebc3ee9efcab635b1f3e14b9198a58ae93c233 (patch) | |
tree | 81e3ad66cd4ec8693964317cbf23515d0e9ecf35 /sql/rpl_injector.cc | |
parent | a22a339f8e044a1e8df011beb0b4c8f43792ac96 (diff) | |
download | mariadb-git-30ebc3ee9efcab635b1f3e14b9198a58ae93c233.tar.gz |
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()
Diffstat (limited to 'sql/rpl_injector.cc')
-rw-r--r-- | sql/rpl_injector.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index b855dec35f9..3c0ec34f352 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -105,7 +105,7 @@ int injector::transaction::use_table(server_id_type sid, table tbl) int error; - if ((error= check_state(TABLE_STATE))) + if (unlikely((error= check_state(TABLE_STATE)))) DBUG_RETURN(error); server_id_type save_id= m_thd->variables.server_id; @@ -180,7 +180,8 @@ void injector::new_trans(THD *thd, injector::transaction *ptr) int injector::record_incident(THD *thd, Incident incident) { Incident_log_event ev(thd, incident); - if (int error= mysql_bin_log.write(&ev)) + int error; + if (unlikely((error= mysql_bin_log.write(&ev)))) return error; return mysql_bin_log.rotate_and_purge(true); } @@ -189,7 +190,8 @@ int injector::record_incident(THD *thd, Incident incident, const LEX_CSTRING *message) { Incident_log_event ev(thd, incident, message); - if (int error= mysql_bin_log.write(&ev)) + int error; + if (unlikely((error= mysql_bin_log.write(&ev)))) return error; return mysql_bin_log.rotate_and_purge(true); } |