Raymond Toy pushed to branch issue-242-c-call-char-result-wrong at cmucl / cmucl
Commits:
88d71368 by Raymond Toy at 2023-06-30T14:17:04-07:00
Change `signed short` to `short`
`short` is always signed.
- - - - -
1 changed file:
- tests/test-return.c
Changes:
=====================================
tests/test-return.c
=====================================
@@ -6,10 +6,10 @@ int_to_signed_char(int x)
return (signed char) x;
}
-signed short
+short
int_to_short(int x)
{
- return (signed short) x;
+ return (short) x;
}
int
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/88d71368da29315d7b6a457…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/88d71368da29315d7b6a457…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
1fcdbdb2 by Raymond Toy at 2023-06-19T14:17:30-07:00
Fix typo in docstring for EQUAL
- - - - -
1 changed file:
- src/code/pred.lisp
Changes:
=====================================
src/code/pred.lisp
=====================================
@@ -387,8 +387,8 @@
(defun equal (x y)
"Returns T if X and Y are EQL or if they are structured components
whose elements are EQUAL. Strings and bit-vectors are EQUAL if they
- are the same length and have indentical components. Other arrays must be
- EQ to be EQUAL."
+ are the same length and have identical components. Other arrays
+ must be EQ to be EQUAL."
(cond ((eql x y) t)
((consp x)
(and (consp y)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/1fcdbdb22254820b3b1ae75…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/1fcdbdb22254820b3b1ae75…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-156-take-2-nan-comparison at cmucl / cmucl
Commits:
6162e5b4 by Jon Boone at 2023-05-09T17:38:36+00:00
Fix #143 - Adds argument checking for lisp-streams and Gray sttreams for LISTEN
- - - - -
e472bd4f by Jon Boone at 2023-05-09T17:38:47+00:00
Merge branch 'issue-143-ansi-compliance-failure-listen-extra-argument' into 'master'
Fix #143 - Adds argument checking for lisp-streams and Gray sttreams for LISTEN
Closes #143
See merge request cmucl/cmucl!145
- - - - -
a4c000f9 by Raymond Toy at 2023-05-10T11:48:33-07:00
Update cmucl.pot
Issue #143 updated a docstring so the pot file needs updating.
- - - - -
ee480fbf by Raymond Toy at 2023-05-10T11:49:20-07:00
Update release notes
Issue #143 has been fixed.
- - - - -
7774063f by Raymond Toy at 2023-05-12T16:28:16-07:00
Update pot files for Darwin
- - - - -
d53c9575 by Raymond Toy at 2023-05-12T16:43:51-07:00
Update cmucl.pot and cmucl-unix.pot for Linux
See also #223.
- - - - -
d533ca2c by Raymond Toy at 2023-05-13T07:02:39-07:00
Update file version to 21e
Add the required bootstrap file and update CI to use it.
- - - - -
28167cf6 by Raymond Toy at 2023-05-13T07:05:04-07:00
Update all translations
- - - - -
e82bebb7 by Raymond Toy at 2023-05-13T17:29:42-07:00
Update release notes for 21e.
Basically just remove the WIP section title.
- - - - -
84ec62e3 by Raymond Toy at 2023-05-16T23:47:44+00:00
Address #195: Use relocatable stacks by default
- - - - -
78acc885 by Raymond Toy at 2023-05-16T23:47:53+00:00
Merge branch 'issue-195-relocatable-stacks-by-default' into 'master'
Address #195: Use relocatable stacks by default
See merge request cmucl/cmucl!146
- - - - -
95429eb4 by Raymond Toy at 2023-05-16T16:55:54-07:00
Fix a couple of compiler warnings for functions with no args
The warning is:
> warning: a function declaration without a prototype is deprecated in
> all versions of C [-Wstrict-prototypes]
So update the two places this occurs and add `void`.
- - - - -
a67cb2e8 by Raymond Toy at 2023-05-20T23:43:21+00:00
Update Version to default to hint at version 21e, the latest release.
- - - - -
ac7d904b by Raymond Toy at 2023-05-22T16:16:29-07:00
Update docstring for *default-external-format*
Add a note that `*default-external-format*` is not affected by any
locale settings nor by `set-system-external-format`.
`set-system-external-format` already has a note that it does not
affect `*default-external-format*`.
- - - - -
b871db2b by Raymond Toy at 2023-05-24T17:15:28+00:00
Fix #228: Update ansi-tests from upstream
- - - - -
6683933b by Raymond Toy at 2023-05-24T17:15:31+00:00
Merge branch 'issue-228-update-ansi-tests' into 'master'
Fix #228: Update ansi-tests from upstream
Closes #228
See merge request cmucl/cmucl!150
- - - - -
dcb8124f by Raymond Toy at 2023-05-29T06:42:23-07:00
Add a simple template for release notes
Supply a template for release notes that has the various parts to be
filled in.
This probably needs some tweaking. I'm no longer clear on the
differences between "Changes", "ANSI compliance fixes", "Bug fixes",
and "Gitlab tickets".
- - - - -
648c1127 by Raymond Toy at 2023-05-31T03:55:52+00:00
Fix #216: enough-namestring with relative pathname fails
- - - - -
660ab4c5 by Raymond Toy at 2023-05-31T03:56:07+00:00
Merge branch 'issue-216-enough-namestring-relative-dir' into 'master'
Fix #216: enough-namestring with relative pathname fails
Closes #216
See merge request cmucl/cmucl!152
- - - - -
a2fa2dae by Raymond Toy at 2023-06-02T15:22:40-07:00
Remove unicode replacement character
There's a Unicode replacement character (U+FFFD) in
src/code/unicode.lisp. I tried to see if I can figure out what
character was actually here, but I couldn't find the original.
There's no point in having it here since it provides no information
other than at some point it got replaced. Might as well remove it.
- - - - -
b1592289 by Jon Boone at 2023-06-19T00:07:56+00:00
Fix #154 - add 'en_US.UTF-8@piglatin' as locale-alias for 'en@piglatin'
- - - - -
361c463b by Jon Boone at 2023-06-19T00:08:11+00:00
Merge branch 'issue-154-piglatin-translation-doesnt-work-anymore' into 'master'
Fix #154 - add 'en_US.UTF-8@piglatin' as locale-alias for 'en@piglatin'
Closes #154 and #216
See merge request cmucl/cmucl!151
- - - - -
d8502e05 by Raymond Toy at 2023-06-19T07:19:00-07:00
Add release notes for 21f
Just pulled in the template and added that #154 has been fixed.
- - - - -
1fcdbdb2 by Raymond Toy at 2023-06-19T14:17:30-07:00
Fix typo in docstring for EQUAL
- - - - -
2bb842c1 by Raymond Toy at 2023-06-26T08:59:47-07:00
Merge branch 'master' into issue-156-take-2-nan-comparison
- - - - -
30 changed files:
- .gitlab-ci.yml
- .gitlab/issue_templates/Bug.md
- bin/build.sh
- + src/bootfiles/21d/boot-21e.lisp
- src/code/extfmts.lisp
- src/code/filesys.lisp
- src/code/intl.lisp
- src/code/pred.lisp
- src/code/sparc-svr4-vm.lisp
- src/code/stream.lisp
- src/code/unicode.lisp
- src/code/x86-vm.lisp
- src/compiler/byte-comp.lisp
- src/general-info/release-21e.md
- + src/general-info/release-21f.md
- + src/general-info/release-template.md
- src/i18n/locale/cmucl.pot
- src/i18n/locale/en(a)piglatin/LC_MESSAGES/cmucl-bsd-os.po
- src/i18n/locale/en(a)piglatin/LC_MESSAGES/cmucl-linux-os.po
- src/i18n/locale/en(a)piglatin/LC_MESSAGES/cmucl-unix.po
- src/i18n/locale/en(a)piglatin/LC_MESSAGES/cmucl-x86-vm.po
- src/i18n/locale/en(a)piglatin/LC_MESSAGES/cmucl.po
- src/i18n/locale/ko/LC_MESSAGES/cmucl-bsd-os.po
- src/i18n/locale/ko/LC_MESSAGES/cmucl-linux-os.po
- src/i18n/locale/ko/LC_MESSAGES/cmucl-unix.po
- src/i18n/locale/ko/LC_MESSAGES/cmucl-x86-vm.po
- src/i18n/locale/ko/LC_MESSAGES/cmucl.po
- src/lisp/Linux-os.c
- src/lisp/solaris-os.c
- src/lisp/sparc-validate.h
The diff was not included because it is too large.
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/0c089ccc6c2ed2e35902c1…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/0c089ccc6c2ed2e35902c1…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-187-imul-disassembly at cmucl / cmucl
Commits:
bbfff3c0 by Raymond Toy at 2023-04-10T15:11:59+00:00
Fix #170: Move get-system-info to C
- - - - -
5196072a by Raymond Toy at 2023-04-10T15:12:01+00:00
Merge branch 'issue-179-get-system-info-in-c' into 'master'
Fix #170: Move get-system-info to C
Closes #170
See merge request cmucl/cmucl!137
- - - - -
b2aee0f7 by Raymond Toy at 2023-04-17T08:14:29-07:00
Update cmucl.pot with latest source
Some docstrings have changed, so update cmucl.pot
- - - - -
fbb742ae by Raymond Toy at 2023-04-19T14:14:39+00:00
Fix #120: software-version in C
- - - - -
501ca837 by Raymond Toy at 2023-04-19T14:14:40+00:00
Merge branch 'issue-120-software-type-in-c' into 'master'
Fix #120: software-version in C
Closes #120, #130, #146, #136, #142, #134, and #132
See merge request cmucl/cmucl!93
- - - - -
2556df76 by Raymond Toy at 2023-04-19T07:38:34-07:00
Update pot files
Forgot to update these in the merges, so let's do them all now.
- - - - -
38daa5e2 by Raymond Toy at 2023-04-19T15:13:28+00:00
Add missing colon after "Version"
- - - - -
de972bb3 by Raymond Toy at 2023-04-19T15:32:14+00:00
Merge branch 'rtoy-master-patch-80206' into 'master'
Add missing colon after "Version"
See merge request cmucl/cmucl!140
- - - - -
f52fcecb by Raymond Toy at 2023-04-21T13:35:02+00:00
Fix #180: Move get-page-size to C
- - - - -
412d6523 by Raymond Toy at 2023-04-21T13:35:02+00:00
Merge branch 'issue-180-get-page-size-in-c' into 'master'
Fix #180: Move get-page-size to C
Closes #180
See merge request cmucl/cmucl!136
- - - - -
d12cf1cf by Raymond Toy at 2023-04-21T06:35:47-07:00
Debugging of imul disassembly.
- - - - -
31825793 by Raymond Toy at 2023-04-25T20:49:36+00:00
Fix #189: Move get-system-info from unix.lisp to os.lisp
- - - - -
90a5e569 by Raymond Toy at 2023-04-25T20:49:36+00:00
Merge branch 'issue-189-move-get-system-info' into 'master'
Fix #189: Move get-system-info from unix.lisp to os.lisp
Closes #189
See merge request cmucl/cmucl!141
- - - - -
2ffba1a9 by Raymond Toy at 2023-04-25T13:50:32-07:00
More debugging changes.
- - - - -
c2a99381 by Raymond Toy at 2023-04-26T21:38:42+00:00
Fix #131: Move unix-uname to contrib/unix
- - - - -
acb29d8f by Raymond Toy at 2023-04-26T21:38:42+00:00
Merge branch 'issue-131-move-unix-uname' into 'master'
Fix #131: Move unix-uname to contrib/unix
Closes #131
See merge request cmucl/cmucl!142
- - - - -
677c3ccf by Raymond Toy at 2023-04-27T22:55:29+00:00
Fix #185: Use shorter instructions on x86
- - - - -
8826d962 by Raymond Toy at 2023-04-27T22:55:39+00:00
Merge branch 'issue-185-x86-shorter-insts' into 'master'
Fix #185: Use shorter instructions on x86
Closes #185
See merge request cmucl/cmucl!138
- - - - -
d4f2a343 by Raymond Toy at 2023-04-28T07:37:43-07:00
Merge branch 'master' into issue-187-imul-disassembly
- - - - -
784a143b by Raymond Toy at 2023-04-29T03:54:43+00:00
Fix #192: Print radix marker in disassemblies; adjust note column
- - - - -
ce57a9f2 by Raymond Toy at 2023-04-29T03:55:21+00:00
Merge branch 'issue-192-disassemble-prints-radix-marker' into 'master'
Fix #192: Print radix marker in disassemblies; adjust note column
Closes #192
See merge request cmucl/cmucl!143
- - - - -
48aa21e0 by Raymond Toy at 2023-04-28T20:59:32-07:00
Update release notes for issue #192
- - - - -
3154df47 by Raymond Toy at 2023-04-30T13:54:45+00:00
Fix #193: Treat NIL and :UNSPECIFIC as equivalent in pathnames
- - - - -
9eec4ee5 by Raymond Toy at 2023-04-30T13:55:56+00:00
Merge branch 'issue-193-nil-unspecific-equivalent' into 'master'
Fix #193: Treat NIL and :UNSPECIFIC as equivalent in pathnames
Closes #193
See merge request cmucl/cmucl!144
- - - - -
a0c4c593 by Raymond Toy at 2023-04-30T07:17:53-07:00
Update pot file
- - - - -
95f592f0 by Raymond Toy at 2023-04-30T07:18:08-07:00
Update release notes for #193
- - - - -
65bf9fa5 by Raymond Toy at 2023-04-30T07:59:16-07:00
Update pot files for Darwin
- - - - -
89bdabd4 by Raymond Toy at 2023-04-30T15:08:48-07:00
More pot file updates on linux.
- - - - -
fa4edacb by Raymond Toy at 2023-05-01T13:09:03-07:00
Update CI to use latest snapshot (2023-04)
- - - - -
6162e5b4 by Jon Boone at 2023-05-09T17:38:36+00:00
Fix #143 - Adds argument checking for lisp-streams and Gray sttreams for LISTEN
- - - - -
e472bd4f by Jon Boone at 2023-05-09T17:38:47+00:00
Merge branch 'issue-143-ansi-compliance-failure-listen-extra-argument' into 'master'
Fix #143 - Adds argument checking for lisp-streams and Gray sttreams for LISTEN
Closes #143
See merge request cmucl/cmucl!145
- - - - -
a4c000f9 by Raymond Toy at 2023-05-10T11:48:33-07:00
Update cmucl.pot
Issue #143 updated a docstring so the pot file needs updating.
- - - - -
ee480fbf by Raymond Toy at 2023-05-10T11:49:20-07:00
Update release notes
Issue #143 has been fixed.
- - - - -
7774063f by Raymond Toy at 2023-05-12T16:28:16-07:00
Update pot files for Darwin
- - - - -
d53c9575 by Raymond Toy at 2023-05-12T16:43:51-07:00
Update cmucl.pot and cmucl-unix.pot for Linux
See also #223.
- - - - -
d533ca2c by Raymond Toy at 2023-05-13T07:02:39-07:00
Update file version to 21e
Add the required bootstrap file and update CI to use it.
- - - - -
28167cf6 by Raymond Toy at 2023-05-13T07:05:04-07:00
Update all translations
- - - - -
e82bebb7 by Raymond Toy at 2023-05-13T17:29:42-07:00
Update release notes for 21e.
Basically just remove the WIP section title.
- - - - -
84ec62e3 by Raymond Toy at 2023-05-16T23:47:44+00:00
Address #195: Use relocatable stacks by default
- - - - -
78acc885 by Raymond Toy at 2023-05-16T23:47:53+00:00
Merge branch 'issue-195-relocatable-stacks-by-default' into 'master'
Address #195: Use relocatable stacks by default
See merge request cmucl/cmucl!146
- - - - -
95429eb4 by Raymond Toy at 2023-05-16T16:55:54-07:00
Fix a couple of compiler warnings for functions with no args
The warning is:
> warning: a function declaration without a prototype is deprecated in
> all versions of C [-Wstrict-prototypes]
So update the two places this occurs and add `void`.
- - - - -
a67cb2e8 by Raymond Toy at 2023-05-20T23:43:21+00:00
Update Version to default to hint at version 21e, the latest release.
- - - - -
ac7d904b by Raymond Toy at 2023-05-22T16:16:29-07:00
Update docstring for *default-external-format*
Add a note that `*default-external-format*` is not affected by any
locale settings nor by `set-system-external-format`.
`set-system-external-format` already has a note that it does not
affect `*default-external-format*`.
- - - - -
b871db2b by Raymond Toy at 2023-05-24T17:15:28+00:00
Fix #228: Update ansi-tests from upstream
- - - - -
6683933b by Raymond Toy at 2023-05-24T17:15:31+00:00
Merge branch 'issue-228-update-ansi-tests' into 'master'
Fix #228: Update ansi-tests from upstream
Closes #228
See merge request cmucl/cmucl!150
- - - - -
dcb8124f by Raymond Toy at 2023-05-29T06:42:23-07:00
Add a simple template for release notes
Supply a template for release notes that has the various parts to be
filled in.
This probably needs some tweaking. I'm no longer clear on the
differences between "Changes", "ANSI compliance fixes", "Bug fixes",
and "Gitlab tickets".
- - - - -
648c1127 by Raymond Toy at 2023-05-31T03:55:52+00:00
Fix #216: enough-namestring with relative pathname fails
- - - - -
660ab4c5 by Raymond Toy at 2023-05-31T03:56:07+00:00
Merge branch 'issue-216-enough-namestring-relative-dir' into 'master'
Fix #216: enough-namestring with relative pathname fails
Closes #216
See merge request cmucl/cmucl!152
- - - - -
a2fa2dae by Raymond Toy at 2023-06-02T15:22:40-07:00
Remove unicode replacement character
There's a Unicode replacement character (U+FFFD) in
src/code/unicode.lisp. I tried to see if I can figure out what
character was actually here, but I couldn't find the original.
There's no point in having it here since it provides no information
other than at some point it got replaced. Might as well remove it.
- - - - -
b1592289 by Jon Boone at 2023-06-19T00:07:56+00:00
Fix #154 - add 'en_US.UTF-8@piglatin' as locale-alias for 'en@piglatin'
- - - - -
361c463b by Jon Boone at 2023-06-19T00:08:11+00:00
Merge branch 'issue-154-piglatin-translation-doesnt-work-anymore' into 'master'
Fix #154 - add 'en_US.UTF-8@piglatin' as locale-alias for 'en@piglatin'
Closes #154 and #216
See merge request cmucl/cmucl!151
- - - - -
d8502e05 by Raymond Toy at 2023-06-19T07:19:00-07:00
Add release notes for 21f
Just pulled in the template and added that #154 has been fixed.
- - - - -
1fcdbdb2 by Raymond Toy at 2023-06-19T14:17:30-07:00
Fix typo in docstring for EQUAL
- - - - -
d829b6e6 by Raymond Toy at 2023-06-26T07:43:21-07:00
Merge branch 'master' into issue-187-imul-disassembly
- - - - -
30 changed files:
- .gitlab-ci.yml
- .gitlab/issue_templates/Bug.md
- bin/build.sh
- + src/bootfiles/21d/boot-21e.lisp
- src/code/bsd-os.lisp
- src/code/exports.lisp
- src/code/extfmts.lisp
- src/code/filesys.lisp
- src/code/hpux-os.lisp
- src/code/intl.lisp
- src/code/irix-os.lisp
- src/code/linux-os.lisp
- src/code/misc.lisp
- + src/code/os.lisp
- src/code/osf1-os.lisp
- src/code/pathname.lisp
- src/code/pred.lisp
- src/code/sparc-svr4-vm.lisp
- src/code/stream.lisp
- src/code/sunos-os.lisp
- src/code/unicode.lisp
- src/code/unix.lisp
- src/code/x86-vm.lisp
- src/compiler/byte-comp.lisp
- src/compiler/disassem.lisp
- src/compiler/x86/insts.lisp
- src/contrib/unix/unix-glibc2.lisp
- src/contrib/unix/unix.lisp
- src/general-info/release-21e.md
- + src/general-info/release-21f.md
The diff was not included because it is too large.
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/30e263020a3ee6d9163605…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/30e263020a3ee6d9163605…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-240-set-diff-with-hash-table at cmucl / cmucl
Commits:
2e46d458 by Raymond Toy at 2023-06-24T08:35:33-07:00
Modify code so we only hash list2
Tests for when we hash list1 containing fixnums show that we're always
much slower that not hashing. But when list1 consists of strings,
we're always better hashing list1. So complicated.
So for now, just hash list2, like what clisp does.
- - - - -
1 changed file:
- src/code/list.lisp
Changes:
=====================================
src/code/list.lisp
=====================================
@@ -785,6 +785,7 @@
(l2 list2 (cdr l2)))
((cond ((endp l2)
(return (values length list2)))
+ #+nil
((endp l1)
(return (values length list1))))))
;; If the list is too short, the hashtable makes things
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/2e46d4581f00c9d3a1df8b3…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/2e46d4581f00c9d3a1df8b3…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-240-set-diff-with-hash-table at cmucl / cmucl
Commits:
bc7826a7 by Raymond Toy at 2023-06-19T14:26:19-07:00
Fix typo in set-difference
The early exist for when list2 is empty had a typo with `list` instead
of `list2`.
- - - - -
1 changed file:
- src/code/list.lisp
Changes:
=====================================
src/code/list.lisp
=====================================
@@ -863,7 +863,7 @@
(if (and testp notp)
(error "Test and test-not both supplied."))
;; Quick exit
- (when (null list)
+ (when (null list2)
(return-from set-difference list1))
(multiple-value-bind (hashtable shorter-list)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/bc7826a734123f627eccc4f…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/bc7826a734123f627eccc4f…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-240-set-diff-with-hash-table at cmucl / cmucl
Commits:
ac30347e by Raymond Toy at 2023-06-19T13:45:44-07:00
Prefer list2 when both lists have the same length
Also add some comments.
- - - - -
57f0451c by Raymond Toy at 2023-06-19T13:48:29-07:00
Allow quick exit in set-difference
Also, now that set-difference is pretty large, don't declare it as
maybe-inline.
- - - - -
1 changed file:
- src/code/list.lisp
Changes:
=====================================
src/code/list.lisp
=====================================
@@ -45,7 +45,7 @@
tree-equal list-length nth %setnth nthcdr last make-list append
copy-list copy-alist copy-tree revappend nconc nreconc butlast
nbutlast ldiff member member-if member-if-not tailp adjoin union
- nunion intersection nintersection set-difference nset-difference
+ nunion intersection nintersection nset-difference
set-exclusive-or nset-exclusive-or subsetp acons pairlis assoc
assoc-if assoc-if-not rassoc rassoc-if rassoc-if-not subst subst-if
subst-if-not nsubst nsubst-if nsubst-if-not sublis nsublis))
@@ -744,11 +744,13 @@
list
(cons item list)))
+;; The minimum length of a list before we can use a hashtable
(defparameter *min-list-length-for-hashtable*
15)
;; Convert a list to a hashtable. Given 2 lists, find the shorter of
-;; the two lists and add the shorter list to a hashtable.
+;; the two lists and add the shorter list to a hashtable. Returns the
+;; hashtable and the shorter list.
(defun list-to-hashtable (list1 list2 &key test test-not key)
;; Don't currently support test-not when converting a list to a hashtable
(unless test-not
@@ -763,13 +765,18 @@
(unless hash-test
(return-from list-to-hashtable (values nil nil)))
(multiple-value-bind (len shorter-list)
+ ;; Find the list with the shorter length. If they're they
+ ;; same, we prefer the second list to the first list since
+ ;; the hashtable implementation is slightly simplier.
(do ((length 0 (1+ length))
(l1 list1 (cdr l1))
(l2 list2 (cdr l2)))
- ((cond ((null l1)
- (return (values length list1)))
- ((null l2)
- (return (values length list2))))))
+ ((cond ((null l2)
+ (return (values length list2)))
+ ((null l1)
+ (return (values length list1))))))
+ ;; If the list is too short, the hashtable makes things
+ ;; slower. We also need to balance memory usage.
(when (< len *min-list-length-for-hashtable*)
(return-from list-to-hashtable (values nil nil)))
(cond ((eq shorter-list list2)
@@ -855,18 +862,20 @@
(declare (inline member))
(if (and testp notp)
(error "Test and test-not both supplied."))
+ ;; Quick exit
+ (when (null list)
+ (return-from set-difference list1))
+
(multiple-value-bind (hashtable shorter-list)
(list-to-hashtable list1 list2 :key key :test test :test-not test-not)
(cond ((null hashtable)
;; Default implementation because we didn't create the hash
;; table.
- (if (null list2)
- list1
- (let ((res nil))
- (dolist (elt list1)
- (if (not (with-set-keys (member (apply-key key elt) list2)))
- (push elt res)))
- res)))
+ (let ((res nil))
+ (dolist (elt list1)
+ (if (not (with-set-keys (member (apply-key key elt) list2)))
+ (push elt res)))
+ res))
((eq shorter-list list2)
;; list2 was placed in hash table.
(let (diff)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/653dc42ff6285a475709fe…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/653dc42ff6285a475709fe…
You're receiving this email because of your account on gitlab.common-lisp.net.