mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-20 03:47:34 +00:00
(intersection): Keep the elements of the returned list
in the same order as in the first list.
This commit is contained in:
parent
b670783a4b
commit
eef762fc0f
2 changed files with 12 additions and 4 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2002-05-11 Andreas Schwab <schwab@suse.de>
|
||||
|
||||
* coding.c (intersection): Keep the elements of the returned list
|
||||
in the same order as in the first list.
|
||||
|
||||
2002-05-11 Kim F. Storm <storm@cua.dk>
|
||||
|
||||
* keymap.c (current_minor_maps): Fixed resizing of cmm_maps;
|
||||
|
|
|
|||
11
src/coding.c
11
src/coding.c
|
|
@ -6324,14 +6324,17 @@ static Lisp_Object
|
|||
intersection (l1, l2)
|
||||
Lisp_Object l1, l2;
|
||||
{
|
||||
Lisp_Object val;
|
||||
Lisp_Object val = Fcons (Qnil, Qnil), tail;
|
||||
|
||||
for (val = Qnil; CONSP (l1); l1 = XCDR (l1))
|
||||
for (tail = val; CONSP (l1); l1 = XCDR (l1))
|
||||
{
|
||||
if (!NILP (Fmemq (XCAR (l1), l2)))
|
||||
val = Fcons (XCAR (l1), val);
|
||||
{
|
||||
XSETCDR (tail, Fcons (XCAR (l1), Qnil));
|
||||
tail = XCDR (tail);
|
||||
}
|
||||
}
|
||||
return val;
|
||||
return XCDR (val);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue