1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

textarea_edit: convert unnecessary checks to assertions

If @op == 0, then @fs_, @doc_view_, @link_, and @term_ should all be set.  Assert them instead of checking them with if statements.
This commit is contained in:
Miciah Dashiel Butler Masters 2007-08-30 21:09:14 +00:00 committed by Miciah Dashiel Butler Masters
parent 06adbbc524
commit 360b4ebfee

View File

@ -608,6 +608,8 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
NULL);
unsigned char *ex;
assert(fs_ && doc_view_ && link_ && term_);
fn = save_textarea_file(fs_->value);
if (!fn) return;
@ -622,13 +624,11 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
goto free_and_return;
}
if (fs_) fs = fs_;
if (doc_view_) doc_view = doc_view_;
if (link_) {
link = link_;
fc_maxlength = get_link_form_control(link_)->maxlength;
}
if (term_) term = term_;
fs = fs_;
doc_view = doc_view_;
link = link_;
fc_maxlength = get_link_form_control(link_)->maxlength;
term = term_;
exec_on_terminal(term, ex, "", TERM_EXEC_FG);
mem_free(ex);