diff options
author | Andy Wingo <wingo@pobox.com> | 2011-07-29 09:17:47 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-07-29 09:17:47 +0200 |
commit | 0f75cc78096578f85cc66bba054044116e2ca413 (patch) | |
tree | 6d3ffb5eb28f71b96509e958c84049c44afad2dd /libguile/stacks.c | |
parent | 89f886122a37a051087fbfbbab5400a29a661b06 (diff) | |
download | guile-0f75cc78096578f85cc66bba054044116e2ca413.tar.gz |
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.
Diffstat (limited to 'libguile/stacks.c')
-rw-r--r-- | libguile/stacks.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libguile/stacks.c b/libguile/stacks.c index 86188f416..d0e82f7bd 100644 --- a/libguile/stacks.c +++ b/libguile/stacks.c @@ -184,11 +184,10 @@ narrow_stack (SCM stack, long inner, SCM inner_key, long outer, SCM outer_key) else { /* Cut specified number of frames. */ - for (; outer && len ; --outer) - { - frame = scm_stack_ref (stack, scm_from_long (len - 1)); - len--; - } + if (outer < len) + len -= outer; + else + len = 0; } SCM_SET_STACK_LENGTH (stack, len); |