mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
branches/zip: Minor cleanup.
row_upd_sec_index_entry(): Remove redundant goto. Replace duplicated cleanup code with goto func_exit. mtr_memo_slot_release(): Eliminate the #else branch of #ifdef UNIV_DEBUG by reorganizing the code.
This commit is contained in:
parent
7181f05870
commit
5e0d677f0b
2 changed files with 5 additions and 14 deletions
|
@ -54,16 +54,13 @@ mtr_memo_slot_release(
|
|||
} else if (type == MTR_MEMO_S_LOCK) {
|
||||
rw_lock_s_unlock((rw_lock_t*)object);
|
||||
#ifdef UNIV_DEBUG
|
||||
} else if (type == MTR_MEMO_X_LOCK) {
|
||||
rw_lock_x_unlock((rw_lock_t*)object);
|
||||
} else {
|
||||
} else if (type != MTR_MEMO_X_LOCK) {
|
||||
ut_ad(type == MTR_MEMO_MODIFY);
|
||||
ut_ad(mtr_memo_contains(mtr, object,
|
||||
MTR_MEMO_PAGE_X_FIX));
|
||||
#else
|
||||
#endif /* UNIV_DEBUG */
|
||||
} else {
|
||||
rw_lock_x_unlock((rw_lock_t*)object);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1347,23 +1347,16 @@ row_upd_sec_index_entry(
|
|||
node,
|
||||
&pcur, index->table,
|
||||
index, thr, &mtr);
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
goto close_cur;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
close_cur:
|
||||
|
||||
btr_pcur_close(&pcur);
|
||||
mtr_commit(&mtr);
|
||||
|
||||
if (node->is_delete || err != DB_SUCCESS) {
|
||||
|
||||
mem_heap_free(heap);
|
||||
|
||||
return(err);
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
/* Build a new index entry */
|
||||
|
@ -1372,6 +1365,7 @@ close_cur:
|
|||
/* Insert new index entry */
|
||||
err = row_ins_index_entry(index, entry, NULL, 0, thr);
|
||||
|
||||
func_exit:
|
||||
mem_heap_free(heap);
|
||||
|
||||
return(err);
|
||||
|
|
Loading…
Reference in a new issue