1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* error.c (exc_initialize): calling 'to_str' each time just for

type checking is too heavy.  [ruby-core:02661]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-03-16 23:03:17 +00:00
parent a4d687f1c7
commit ab6963043d
3 changed files with 14 additions and 6 deletions

View file

@ -14,6 +14,11 @@ Tue Mar 16 11:14:17 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* dir.c (fnmatch): File.fnmatch('**/.boo', '.foo/.boo',
File::FNM_PATHNAME) should return false because of leading period.
Mon Mar 15 17:01:07 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* error.c (exc_initialize): calling 'to_str' each time just for
type checking is too heavy. [ruby-core:02661]
Mon Mar 15 10:14:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SocketForwarder):

View file

@ -327,7 +327,7 @@ rb_exc_new3(etype, str)
VALUE etype, str;
{
StringValue(str);
return rb_exc_new(etype, RSTRING(str)->ptr, RSTRING(str)->len);
return rb_funcall(etype, rb_intern("new"), 1, str);
}
/*
@ -346,10 +346,7 @@ exc_initialize(argc, argv, exc)
{
VALUE arg;
if (rb_scan_args(argc, argv, "01", &arg) == 1) {
VALUE mesg = arg;
StringValue(mesg); /* ensure mesg can be converted to String */
}
rb_scan_args(argc, argv, "01", &arg);
rb_iv_set(exc, "mesg", arg);
rb_iv_set(exc, "bt", Qnil);

View file

@ -1264,6 +1264,12 @@ def test_b14
end
test_ok(test_b14() == 144)
def test_b15
[0].each {|c| yield 1 }
156
end
test_ok(test_b15{|e| break 155 } == 155)
def marity_test(m)
method = method(m)
test_ok(method.arity == method.to_proc.arity, 2)
@ -1992,7 +1998,7 @@ module Olympians
@@rule ="Zeus"
def ruler3
@@rule
end
end
end
class Titans < Gods