MDEV-19586: Remove unnecessary iteration

recv_apply_hashed_log_recs(): Refer directly to recs.last->end_lsn
instead of iterating the entire list starting from recs.log.
This commit is contained in:
Marko Mäkelä 2019-06-12 19:36:30 +03:00
parent b6e0d2475c
commit 38018f48b6

View File

@ -2139,12 +2139,7 @@ void recv_apply_hashed_log_recs(bool last_batch)
break;
case recv_sys_t::recs_t::RECV_WILL_NOT_READ:
mlog_init_t::init& i = mlog_init.last(page_id);
lsn_t end_lsn = 0;
for (const recv_t* r = recs.log; r; r = r->next) {
ut_ad(r->end_lsn);
ut_ad(r->end_lsn >= end_lsn);
end_lsn = r->end_lsn;
}
const lsn_t end_lsn = recs.last->end_lsn;
if (end_lsn < i.lsn) {
DBUG_LOG("ib_log", "skip log for page "
<< page_id