aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-11-26 18:57:34 +0800
committerPo Lu2022-11-26 18:58:25 +0800
commit5281e85513bae95bd4a6fce59b6acd0343e3d6bc (patch)
tree70a669e864b6c5921a72ce69e4dd876795c83ea4 /src
parent2eccd6eb5f30749fa63d7366b235356e7b4fdfcd (diff)
downloademacs-5281e85513bae95bd4a6fce59b6acd0343e3d6bc.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c20
-rw-r--r--src/xselect.c8
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,
8455 int min_x, min_y, max_x, max_y = -1; 8455 int min_x, min_y, max_x, max_y = -1;
8456 8456
8457 /* User-specified position? */ 8457 /* User-specified position? */
8458 left = Fcdr (Fassq (Qleft, parms)); 8458 left = CDR (Fassq (Qleft, parms));
8459 top = Fcdr (Fassq (Qtop, parms)); 8459 top = CDR (Fassq (Qtop, parms));
8460 right = Fcdr (Fassq (Qright, parms)); 8460 right = CDR (Fassq (Qright, parms));
8461 bottom = Fcdr (Fassq (Qbottom, parms)); 8461 bottom = CDR (Fassq (Qbottom, parms));
8462 8462
8463 /* Move the tooltip window where the mouse pointer is. Resize and 8463 /* Move the tooltip window where the mouse pointer is. Resize and
8464 show it. */ 8464 show it. */
@@ -8824,14 +8824,14 @@ Text larger than the specified size is clipped. */)
8824 for (tail = parms; CONSP (tail); tail = XCDR (tail)) 8824 for (tail = parms; CONSP (tail); tail = XCDR (tail))
8825 { 8825 {
8826 elt = XCAR (tail); 8826 elt = XCAR (tail);
8827 parm = Fcar (elt); 8827 parm = CAR (elt);
8828 /* The left, top, right and bottom parameters are handled 8828 /* The left, top, right and bottom parameters are handled
8829 by compute_tip_xy so they can be ignored here. */ 8829 by compute_tip_xy so they can be ignored here. */
8830 if (!EQ (parm, Qleft) && !EQ (parm, Qtop) 8830 if (!EQ (parm, Qleft) && !EQ (parm, Qtop)
8831 && !EQ (parm, Qright) && !EQ (parm, Qbottom)) 8831 && !EQ (parm, Qright) && !EQ (parm, Qbottom))
8832 { 8832 {
8833 last = Fassq (parm, tip_last_parms); 8833 last = Fassq (parm, tip_last_parms);
8834 if (NILP (Fequal (Fcdr (elt), Fcdr (last)))) 8834 if (NILP (Fequal (CDR (elt), CDR (last))))
8835 { 8835 {
8836 /* We lost, delete the old tooltip. */ 8836 /* We lost, delete the old tooltip. */
8837 delete = true; 8837 delete = true;
@@ -8852,9 +8852,9 @@ Text larger than the specified size is clipped. */)
8852 for (tail = tip_last_parms; CONSP (tail); tail = XCDR (tail)) 8852 for (tail = tip_last_parms; CONSP (tail); tail = XCDR (tail))
8853 { 8853 {
8854 elt = XCAR (tail); 8854 elt = XCAR (tail);
8855 parm = Fcar (elt); 8855 parm = CAR (elt);
8856 if (!EQ (parm, Qleft) && !EQ (parm, Qtop) && !EQ (parm, Qright) 8856 if (!EQ (parm, Qleft) && !EQ (parm, Qtop) && !EQ (parm, Qright)
8857 && !EQ (parm, Qbottom) && !NILP (Fcdr (elt))) 8857 && !EQ (parm, Qbottom) && !NILP (CDR (elt)))
8858 { 8858 {
8859 /* We lost, delete the old tooltip. */ 8859 /* We lost, delete the old tooltip. */
8860 delete = true; 8860 delete = true;
@@ -8975,8 +8975,8 @@ Text larger than the specified size is clipped. */)
8975 make_fixnum (w->pixel_height), Qnil, 8975 make_fixnum (w->pixel_height), Qnil,
8976 Qnil); 8976 Qnil);
8977 /* Add the frame's internal border to calculated size. */ 8977 /* Add the frame's internal border to calculated size. */
8978 width = XFIXNUM (Fcar (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f); 8978 width = XFIXNUM (CAR (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f);
8979 height = XFIXNUM (Fcdr (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f); 8979 height = XFIXNUM (CDR (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f);
8980 8980
8981 /* Calculate position of tooltip frame. */ 8981 /* Calculate position of tooltip frame. */
8982 compute_tip_xy (tip_f, parms, dx, dy, width, height, &root_x, &root_y); 8982 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,
308 /* We know it's not the CAR, so it's easy. */ 308 /* We know it's not the CAR, so it's easy. */
309 Lisp_Object rest = dpyinfo->terminal->Vselection_alist; 309 Lisp_Object rest = dpyinfo->terminal->Vselection_alist;
310 for (; CONSP (rest); rest = XCDR (rest)) 310 for (; CONSP (rest); rest = XCDR (rest))
311 if (EQ (prev_value, Fcar (XCDR (rest)))) 311 if (EQ (prev_value, CAR (XCDR (rest))))
312 { 312 {
313 XSETCDR (rest, XCDR (XCDR (rest))); 313 XSETCDR (rest, XCDR (XCDR (rest)));
314 break; 314 break;
@@ -369,7 +369,7 @@ x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type,
369 specbind (Qinhibit_quit, Qt); 369 specbind (Qinhibit_quit, Qt);
370 370
371 CHECK_SYMBOL (target_type); 371 CHECK_SYMBOL (target_type);
372 handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist)); 372 handler_fn = CDR (Fassq (target_type, Vselection_converter_alist));
373 373
374 if (CONSP (handler_fn)) 374 if (CONSP (handler_fn))
375 handler_fn = XCDR (handler_fn); 375 handler_fn = XCDR (handler_fn);
@@ -1129,14 +1129,14 @@ x_clear_frame_selections (struct frame *f)
1129 while (CONSP (t->Vselection_alist) 1129 while (CONSP (t->Vselection_alist)
1130 && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (t->Vselection_alist))))))) 1130 && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (t->Vselection_alist)))))))
1131 { 1131 {
1132 selection = Fcar (Fcar (t->Vselection_alist)); 1132 selection = CAR (CAR (t->Vselection_alist));
1133 1133
1134 if (!x_should_preserve_selection (selection)) 1134 if (!x_should_preserve_selection (selection))
1135 /* Run the `x-lost-selection-functions' abnormal hook. */ 1135 /* Run the `x-lost-selection-functions' abnormal hook. */
1136 CALLN (Frun_hook_with_args, Qx_lost_selection_functions, 1136 CALLN (Frun_hook_with_args, Qx_lost_selection_functions,
1137 selection); 1137 selection);
1138 else 1138 else
1139 lost = Fcons (Fcar (t->Vselection_alist), lost); 1139 lost = Fcons (CAR (t->Vselection_alist), lost);
1140 1140
1141 tset_selection_alist (t, XCDR (t->Vselection_alist)); 1141 tset_selection_alist (t, XCDR (t->Vselection_alist));
1142 } 1142 }