1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

field_op: use goto_link (micro-optimisation)

Use the newly introduced goto_link instead of goto_current_link in field_op
since field_op already looks up the current link.
This commit is contained in:
Miciah Dashiel Butler Masters 2008-08-02 00:17:50 +00:00
parent 9e5d79a803
commit d17a632417
3 changed files with 3 additions and 2 deletions

View File

@ -1657,7 +1657,7 @@ field_op(struct session *ses, struct document_view *doc_view,
/* FIXME: We should maybe have ACT_EDIT_ENTER_RELOAD */ /* FIXME: We should maybe have ACT_EDIT_ENTER_RELOAD */
if ((has_form_submit(fc->form) if ((has_form_submit(fc->form)
&& !get_opt_bool("document.browse.forms.auto_submit", ses)) && !get_opt_bool("document.browse.forms.auto_submit", ses))
|| goto_current_link(ses, doc_view, 0)) { || goto_link(ses, doc_view, link, 0)) {
if (ses->insert_mode == INSERT_MODE_ON) if (ses->insert_mode == INSERT_MODE_ON)
ses->insert_mode = INSERT_MODE_OFF; ses->insert_mode = INSERT_MODE_OFF;
status = FRAME_EVENT_OK; status = FRAME_EVENT_OK;

View File

@ -943,7 +943,7 @@ call_onsubmit_and_submit(struct session *ses, struct document_view *doc_view,
return 1; return 1;
} }
static struct link * struct link *
goto_link(struct session *ses, struct document_view *doc_view, struct link *link, int do_reload) goto_link(struct session *ses, struct document_view *doc_view, struct link *link, int do_reload)
{ {
struct uri *uri; struct uri *uri;

View File

@ -47,6 +47,7 @@ int next_link_in_dir(struct document_view *doc_view, int dir_x, int dir_y);
void jump_to_link_number(struct session *ses, struct document_view *doc_view, int); void jump_to_link_number(struct session *ses, struct document_view *doc_view, int);
struct link *goto_current_link(struct session *ses, struct document_view *, int); struct link *goto_current_link(struct session *ses, struct document_view *, int);
struct link *goto_link(struct session *ses, struct document_view *, struct link *, int);
void goto_link_number(struct session *ses, unsigned char *num); void goto_link_number(struct session *ses, unsigned char *num);
void get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x); void get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x);