aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorPaul Eggert2019-07-11 17:01:20 -0700
committerPaul Eggert2019-07-11 17:04:55 -0700
commit77a4cc9f1a7df97c9a11195dcf6e90c8820be9bb (patch)
treeb33ccaa9f460662eea0884bd043fa873cdf38a1e /src/keymap.c
parentef6715364dd94f98dcdf60ff295c89ac856de882 (diff)
downloademacs-77a4cc9f1a7df97c9a11195dcf6e90c8820be9bb.tar.gz
emacs-77a4cc9f1a7df97c9a11195dcf6e90c8820be9bb.zip
Avoid duplicate comparison in describe_map_compare
* src/fns.c (string_version_cmp): New function. This has most of the old Fstring_version_lessp, with an assertion to make things a bit clearer. * src/fns.c (Fstring_version_lessp): * src/keymap.c (describe_map_compare): Use it (Bug#33237).
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/keymap.c b/src/keymap.c
index fc04c565a1e..6762915f70c 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3100,9 +3100,7 @@ describe_map_compare (const void *aa, const void *bb)
3100 if (SYMBOLP (a->event) && SYMBOLP (b->event)) 3100 if (SYMBOLP (a->event) && SYMBOLP (b->event))
3101 /* Sort the keystroke names in the "natural" way, with (for 3101 /* Sort the keystroke names in the "natural" way, with (for
3102 instance) "<f2>" coming between "<f1>" and "<f11>". */ 3102 instance) "<f2>" coming between "<f1>" and "<f11>". */
3103 return (!NILP (Fstring_version_lessp (a->event, b->event)) ? -1 3103 return string_version_cmp (SYMBOL_NAME (a->event), SYMBOL_NAME (b->event));
3104 : !NILP (Fstring_version_lessp (b->event, a->event)) ? 1
3105 : 0);
3106 return 0; 3104 return 0;
3107} 3105}
3108 3106