diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-11-21 07:05:32 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-11-21 07:05:32 -0800 |
commit | 8b237b2dcd460efb9f15494595bc0b429a76a438 (patch) | |
tree | a51cfceea90e3bb3def7f89e7d28d838e4a408a8 /lib.c | |
parent | 7320959c0a70a679011d0a0e0d2e43c586f631ab (diff) | |
download | txr-8b237b2dcd460efb9f15494595bc0b429a76a438.tar.gz txr-8b237b2dcd460efb9f15494595bc0b429a76a438.tar.bz2 txr-8b237b2dcd460efb9f15494595bc0b429a76a438.zip |
* lib.c (partition_by_func): Rename one local variable for clarity.
Remove unessential variable last, and move the next variable
into loop scope.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -1388,16 +1388,16 @@ val tuples(val n, val seq, val fill) static val partition_by_func(val env, val lcons) { list_collect_decl (out, ptail); - cons_bind (seq_func, func, env); - cons_bind (flast, seq_in, seq_func); + cons_bind (flast_seq, func, env); + cons_bind (flast, seq_in, flast_seq); val seq = seq_in; - val last = pop(&seq); - val next, fnext = nil; + val fnext = nil; - ptail = list_collect(ptail, last); + ptail = list_collect(ptail, pop(&seq)); while (seq) { - fnext = funcall1(func, next = car(seq)); + val next = car(seq); + fnext = funcall1(func, next); if (!equal(flast, fnext)) break; @@ -1405,12 +1405,11 @@ static val partition_by_func(val env, val lcons) ptail = list_collect(ptail, next); seq = cdr(seq); - last = next; flast = fnext; } - rplaca(seq_func, fnext); - rplacd(seq_func, seq); + rplaca(flast_seq, fnext); + rplacd(flast_seq, seq); if (seq) rplacd(lcons, make_lazy_cons(lcons_fun(lcons))); |