mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-22 12:30:32 +02:00
simplify narrow_stack.
* libguile/stacks.c (narrow_stack): Simplify outer narrowing by a number of frames. Thanks to http://article.gmane.org/gmane.lisp.guile.devel/12685.
This commit is contained in:
parent
89f886122a
commit
0f75cc7809
1 changed files with 4 additions and 5 deletions
|
@ -184,11 +184,10 @@ narrow_stack (SCM stack, long inner, SCM inner_key, long outer, SCM outer_key)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Cut specified number of frames. */
|
/* Cut specified number of frames. */
|
||||||
for (; outer && len ; --outer)
|
if (outer < len)
|
||||||
{
|
len -= outer;
|
||||||
frame = scm_stack_ref (stack, scm_from_long (len - 1));
|
else
|
||||||
len--;
|
len = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_SET_STACK_LENGTH (stack, len);
|
SCM_SET_STACK_LENGTH (stack, len);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue