Commit 00ddce11 authored by marko's avatar marko

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.
parent 09e017ca
...@@ -54,16 +54,13 @@ mtr_memo_slot_release( ...@@ -54,16 +54,13 @@ mtr_memo_slot_release(
} else if (type == MTR_MEMO_S_LOCK) { } else if (type == MTR_MEMO_S_LOCK) {
rw_lock_s_unlock((rw_lock_t*)object); rw_lock_s_unlock((rw_lock_t*)object);
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
} else if (type == MTR_MEMO_X_LOCK) { } else if (type != MTR_MEMO_X_LOCK) {
rw_lock_x_unlock((rw_lock_t*)object);
} else {
ut_ad(type == MTR_MEMO_MODIFY); ut_ad(type == MTR_MEMO_MODIFY);
ut_ad(mtr_memo_contains(mtr, object, ut_ad(mtr_memo_contains(mtr, object,
MTR_MEMO_PAGE_X_FIX)); MTR_MEMO_PAGE_X_FIX));
#else #endif /* UNIV_DEBUG */
} else { } else {
rw_lock_x_unlock((rw_lock_t*)object); rw_lock_x_unlock((rw_lock_t*)object);
#endif
} }
} }
......
...@@ -1347,23 +1347,16 @@ row_upd_sec_index_entry( ...@@ -1347,23 +1347,16 @@ row_upd_sec_index_entry(
node, node,
&pcur, index->table, &pcur, index->table,
index, thr, &mtr); index, thr, &mtr);
if (err != DB_SUCCESS) {
goto close_cur;
}
} }
} }
} }
close_cur:
btr_pcur_close(&pcur); btr_pcur_close(&pcur);
mtr_commit(&mtr); mtr_commit(&mtr);
if (node->is_delete || err != DB_SUCCESS) { if (node->is_delete || err != DB_SUCCESS) {
mem_heap_free(heap); goto func_exit;
return(err);
} }
/* Build a new index entry */ /* Build a new index entry */
...@@ -1372,6 +1365,7 @@ row_upd_sec_index_entry( ...@@ -1372,6 +1365,7 @@ row_upd_sec_index_entry(
/* Insert new index entry */ /* Insert new index entry */
err = row_ins_index_entry(index, entry, NULL, 0, thr); err = row_ins_index_entry(index, entry, NULL, 0, thr);
func_exit:
mem_heap_free(heap); mem_heap_free(heap);
return(err); return(err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment