mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 06:20:23 +02:00
* srfi/srfi-1.c (srfi1_ilength), libguile/list.c (scm_ilength,
scm_last_pair), libguile/unif.c (l2ra): Prefer !SCM_CONSP over SCM_NCONSP. * libguile/unif.c (l2ra): Eliminate redundant check. Now, guile itself does not include any calls to SCM_NCONSP any more.
This commit is contained in:
parent
9ff1720f85
commit
1685446c0d
5 changed files with 22 additions and 8 deletions
|
@ -1,3 +1,11 @@
|
|||
2003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* list.c (scm_ilength, scm_last_pair), unif.c (l2ra):Prefer
|
||||
!SCM_CONSP over SCM_NCONSP. Now, guile itself does not include
|
||||
any calls to SCM_NCONSP any more.
|
||||
|
||||
* unif.c (l2ra): Eliminate redundant check.
|
||||
|
||||
2003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product,
|
||||
|
|
|
@ -171,11 +171,11 @@ scm_ilength(SCM sx)
|
|||
|
||||
do {
|
||||
if (SCM_NULL_OR_NIL_P(hare)) return i;
|
||||
if (SCM_NCONSP(hare)) return -1;
|
||||
if (!SCM_CONSP (hare)) return -1;
|
||||
hare = SCM_CDR(hare);
|
||||
i++;
|
||||
if (SCM_NULL_OR_NIL_P(hare)) return i;
|
||||
if (SCM_NCONSP(hare)) return -1;
|
||||
if (!SCM_CONSP (hare)) return -1;
|
||||
hare = SCM_CDR(hare);
|
||||
i++;
|
||||
/* For every two steps the hare takes, the tortoise takes one. */
|
||||
|
@ -292,10 +292,10 @@ SCM_DEFINE (scm_last_pair, "last-pair", 1, 0, 0,
|
|||
SCM_VALIDATE_CONS (SCM_ARG1, lst);
|
||||
do {
|
||||
SCM ahead = SCM_CDR(hare);
|
||||
if (SCM_NCONSP(ahead)) return hare;
|
||||
if (!SCM_CONSP (ahead)) return hare;
|
||||
hare = ahead;
|
||||
ahead = SCM_CDR(hare);
|
||||
if (SCM_NCONSP(ahead)) return hare;
|
||||
if (!SCM_CONSP (ahead)) return hare;
|
||||
hare = ahead;
|
||||
tortoise = SCM_CDR(tortoise);
|
||||
}
|
||||
|
|
|
@ -2215,7 +2215,7 @@ l2ra (SCM lst, SCM ra, unsigned long base, unsigned long k)
|
|||
{
|
||||
while (n--)
|
||||
{
|
||||
if (SCM_IMP (lst) || SCM_NCONSP (lst))
|
||||
if (!SCM_CONSP (lst))
|
||||
return 0;
|
||||
ok = ok && l2ra (SCM_CAR (lst), ra, base, k + 1);
|
||||
base += inc;
|
||||
|
@ -2228,7 +2228,7 @@ l2ra (SCM lst, SCM ra, unsigned long base, unsigned long k)
|
|||
{
|
||||
while (n--)
|
||||
{
|
||||
if (SCM_IMP (lst) || SCM_NCONSP (lst))
|
||||
if (!SCM_CONSP (lst))
|
||||
return 0;
|
||||
scm_array_set_x (SCM_ARRAY_V (ra), SCM_CAR (lst), SCM_MAKINUM (base));
|
||||
base += inc;
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* srfi-1.c (srfi1_ilength): Prefer !SCM_CONSP over SCM_NCONSP.
|
||||
Now, guile itself does not include any calls to SCM_NCONSP any
|
||||
more.
|
||||
|
||||
2003-04-05 Marius Vollmer <mvo@zagadka.de>
|
||||
|
||||
* Changed license terms to the plain LGPL thru-out.
|
||||
|
|
|
@ -38,11 +38,11 @@ srfi1_ilength (SCM sx)
|
|||
|
||||
do {
|
||||
if (SCM_NULL_OR_NIL_P(hare)) return i;
|
||||
if (SCM_NCONSP(hare)) return -2;
|
||||
if (!SCM_CONSP (hare)) return -2;
|
||||
hare = SCM_CDR(hare);
|
||||
i++;
|
||||
if (SCM_NULL_OR_NIL_P(hare)) return i;
|
||||
if (SCM_NCONSP(hare)) return -2;
|
||||
if (!SCM_CONSP (hare)) return -2;
|
||||
hare = SCM_CDR(hare);
|
||||
i++;
|
||||
/* For every two steps the hare takes, the tortoise takes one. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue