diff options
author | Po Lu <luangruo@yahoo.com> | 2022-11-26 18:57:34 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-11-26 18:58:25 +0800 |
commit | 5281e85513bae95bd4a6fce59b6acd0343e3d6bc (patch) | |
tree | 70a669e864b6c5921a72ce69e4dd876795c83ea4 | |
parent | 2eccd6eb5f30749fa63d7366b235356e7b4fdfcd (diff) | |
download | emacs-5281e85513bae95bd4a6fce59b6acd0343e3d6bc.tar.gz emacs-5281e85513bae95bd4a6fce59b6acd0343e3d6bc.tar.bz2 emacs-5281e85513bae95bd4a6fce59b6acd0343e3d6bc.zip |
Reduce wasted cycles in x*.c
* src/xfns.c (compute_tip_xy, Fx_show_tip):
* src/xselect.c (x_own_selection, x_get_local_selection)
(x_clear_frame_selections): Call CAR and CDR, not Fcar and Fcdr.
-rw-r--r-- | src/xfns.c | 20 | ||||
-rw-r--r-- | src/xselect.c | 8 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/xfns.c b/src/xfns.c index fa2c0751d90..36b51a30112 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -8455,10 +8455,10 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, int min_x, min_y, max_x, max_y = -1; /* User-specified position? */ - left = Fcdr (Fassq (Qleft, parms)); - top = Fcdr (Fassq (Qtop, parms)); - right = Fcdr (Fassq (Qright, parms)); - bottom = Fcdr (Fassq (Qbottom, parms)); + left = CDR (Fassq (Qleft, parms)); + top = CDR (Fassq (Qtop, parms)); + right = CDR (Fassq (Qright, parms)); + bottom = CDR (Fassq (Qbottom, parms)); /* Move the tooltip window where the mouse pointer is. Resize and show it. */ @@ -8824,14 +8824,14 @@ Text larger than the specified size is clipped. */) for (tail = parms; CONSP (tail); tail = XCDR (tail)) { elt = XCAR (tail); - parm = Fcar (elt); + parm = CAR (elt); /* The left, top, right and bottom parameters are handled by compute_tip_xy so they can be ignored here. */ if (!EQ (parm, Qleft) && !EQ (parm, Qtop) && !EQ (parm, Qright) && !EQ (parm, Qbottom)) { last = Fassq (parm, tip_last_parms); - if (NILP (Fequal (Fcdr (elt), Fcdr (last)))) + if (NILP (Fequal (CDR (elt), CDR (last)))) { /* We lost, delete the old tooltip. */ delete = true; @@ -8852,9 +8852,9 @@ Text larger than the specified size is clipped. */) for (tail = tip_last_parms; CONSP (tail); tail = XCDR (tail)) { elt = XCAR (tail); - parm = Fcar (elt); + parm = CAR (elt); if (!EQ (parm, Qleft) && !EQ (parm, Qtop) && !EQ (parm, Qright) - && !EQ (parm, Qbottom) && !NILP (Fcdr (elt))) + && !EQ (parm, Qbottom) && !NILP (CDR (elt))) { /* We lost, delete the old tooltip. */ delete = true; @@ -8975,8 +8975,8 @@ Text larger than the specified size is clipped. */) make_fixnum (w->pixel_height), Qnil, Qnil); /* Add the frame's internal border to calculated size. */ - width = XFIXNUM (Fcar (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f); - height = XFIXNUM (Fcdr (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f); + width = XFIXNUM (CAR (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f); + height = XFIXNUM (CDR (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f); /* Calculate position of tooltip frame. */ compute_tip_xy (tip_f, parms, dx, dy, width, height, &root_x, &root_y); diff --git a/src/xselect.c b/src/xselect.c index a381fa23522..844ef7220a9 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -308,7 +308,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, /* We know it's not the CAR, so it's easy. */ Lisp_Object rest = dpyinfo->terminal->Vselection_alist; for (; CONSP (rest); rest = XCDR (rest)) - if (EQ (prev_value, Fcar (XCDR (rest)))) + if (EQ (prev_value, CAR (XCDR (rest)))) { XSETCDR (rest, XCDR (XCDR (rest))); break; @@ -369,7 +369,7 @@ x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, specbind (Qinhibit_quit, Qt); CHECK_SYMBOL (target_type); - handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist)); + handler_fn = CDR (Fassq (target_type, Vselection_converter_alist)); if (CONSP (handler_fn)) handler_fn = XCDR (handler_fn); @@ -1129,14 +1129,14 @@ x_clear_frame_selections (struct frame *f) while (CONSP (t->Vselection_alist) && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (t->Vselection_alist))))))) { - selection = Fcar (Fcar (t->Vselection_alist)); + selection = CAR (CAR (t->Vselection_alist)); if (!x_should_preserve_selection (selection)) /* Run the `x-lost-selection-functions' abnormal hook. */ CALLN (Frun_hook_with_args, Qx_lost_selection_functions, selection); else - lost = Fcons (Fcar (t->Vselection_alist), lost); + lost = Fcons (CAR (t->Vselection_alist), lost); tset_selection_alist (t, XCDR (t->Vselection_alist)); } |