diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-14 15:39:39 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-14 15:39:39 +0000 |
| commit | 0bfdf4fc2a07f85880c6db4077d0aebbdff69914 (patch) | |
| tree | e48948b68a953fe0a31e18cbcc98ba1366c063d8 /range.c | |
| parent | b78a7ccb8f286bdda2f4c11da2343508ba552591 (diff) | |
| download | ruby-0bfdf4fc2a07f85880c6db4077d0aebbdff69914.tar.gz ruby-0bfdf4fc2a07f85880c6db4077d0aebbdff69914.tar.xz ruby-0bfdf4fc2a07f85880c6db4077d0aebbdff69914.zip | |
* eval.c (rb_rescue2): reduce PUSH_TAG() as well as NODE_RESCUE.
[ruby-dev:26800]
* range.c (range_check, range_init): reduce uselse exceptions.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
| -rw-r--r-- | range.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -29,11 +29,7 @@ static VALUE range_check(args) VALUE *args; { - VALUE v; - - v = rb_funcall(args[0], id_cmp, 1, args[1]); - if (NIL_P(v)) range_failed(); - return Qnil; + return rb_funcall(args[0], id_cmp, 1, args[1]); } static void @@ -47,7 +43,10 @@ range_init(range, beg, end, exclude_end) args[1] = end; if (!FIXNUM_P(beg) || !FIXNUM_P(end)) { - rb_rescue(range_check, (VALUE)args, range_failed, 0); + VALUE v; + + v = rb_rescue(range_check, (VALUE)args, range_failed, 0); + if (NIL_P(v)) range_failed(); } SET_EXCL(range, exclude_end); |
