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(
} 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);
......
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