diff options
| author | Paul Eggert | 2019-01-09 09:52:38 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-01-09 09:59:10 -0800 |
| commit | a84650334e30b2451bf4a8957bf2d57ade296d4e (patch) | |
| tree | b5642bb98eb89733def116fb6d864f74855023e2 /src/fringe.c | |
| parent | f9d0fd6c1953138f7473a22917a1508740b2ce40 (diff) | |
| download | emacs-a84650334e30b2451bf4a8957bf2d57ade296d4e.tar.gz emacs-a84650334e30b2451bf4a8957bf2d57ade296d4e.zip | |
Use shortcuts for Flength
When calculating the length of a Lisp object whose type is
known, use a specialized length operation on it to save a bit
of runtime overhead.
* src/callint.c (Fcall_interactively):
* src/minibuf.c (read_minibuf_unwind):
Use ASIZE rather than Flength on values that must be vectors.
* src/charset.c (Fsort_charsets):
* src/coding.c (detect_coding_sjis):
(Fdefine_coding_system_internal):
* src/data.c (wrong_choice):
* src/eval.c (Flet, eval_sub, Fapply, apply_lambda):
* src/fns.c (sort_list):
* src/font.c (font_vconcat_entity_vectors)
(font_find_for_lface):
* src/frame.c (Fmodify_frame_parameters):
* src/fringe.c (get_logical_fringe_bitmap):
* src/ftfont.c (ftfont_get_open_type_spec):
* src/gtkutil.c (xg_print_frames_dialog):
* src/lread.c (read1, read_vector):
* src/keymap.c (Fkey_description):
* src/kqueue.c (Fkqueue_add_watch):
* src/macfont.m (macfont_get_open_type_spec):
* src/menu.c (parse_single_submenu, x_popup_menu_1):
* src/minibuf.c (Finternal_complete_buffer):
* src/nsfont.m (ns_findfonts, nsfont_list_family):
* src/process.c (Fmake_process):
* src/search.c (Fset_match_data):
* src/xfaces.c (Fx_family_fonts):
Use list_length rather than Flength on values that must be lists.
* src/fns.c (list_length): New function.
(Flength): Use it.
* src/nsfont.m (ns_findfonts):
Use !NILP (x) rather than XFIXNUM (Flength (x)) != 0.
* src/xdisp.c (store_mode_line_string):
Use SCHARS rather than Flength on values that must be strings.
Diffstat (limited to 'src/fringe.c')
| -rw-r--r-- | src/fringe.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fringe.c b/src/fringe.c index a7e8dad482e..74f41f00873 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -719,7 +719,7 @@ static int | |||
| 719 | get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, int partial_p) | 719 | get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, int partial_p) |
| 720 | { | 720 | { |
| 721 | Lisp_Object cmap, bm1 = Qnil, bm2 = Qnil, bm; | 721 | Lisp_Object cmap, bm1 = Qnil, bm2 = Qnil, bm; |
| 722 | EMACS_INT ln1 = 0, ln2 = 0; | 722 | ptrdiff_t ln1 = 0, ln2 = 0; |
| 723 | int ix1 = right_p; | 723 | int ix1 = right_p; |
| 724 | int ix2 = ix1 + (partial_p ? 2 : 0); | 724 | int ix2 = ix1 + (partial_p ? 2 : 0); |
| 725 | 725 | ||
| @@ -743,7 +743,7 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in | |||
| 743 | return NO_FRINGE_BITMAP; | 743 | return NO_FRINGE_BITMAP; |
| 744 | if (CONSP (bm1)) | 744 | if (CONSP (bm1)) |
| 745 | { | 745 | { |
| 746 | ln1 = XFIXNUM (Flength (bm1)); | 746 | ln1 = list_length (bm1); |
| 747 | if (partial_p) | 747 | if (partial_p) |
| 748 | { | 748 | { |
| 749 | if (ln1 > ix2) | 749 | if (ln1 > ix2) |
| @@ -778,7 +778,7 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in | |||
| 778 | { | 778 | { |
| 779 | if (CONSP (bm2)) | 779 | if (CONSP (bm2)) |
| 780 | { | 780 | { |
| 781 | ln2 = XFIXNUM (Flength (bm2)); | 781 | ln2 = list_length (bm2); |
| 782 | if (partial_p) | 782 | if (partial_p) |
| 783 | { | 783 | { |
| 784 | if (ln2 > ix2) | 784 | if (ln2 > ix2) |