diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-16 23:03:17 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-16 23:03:17 +0000 |
commit | ab6963043df202bde77d67dfabff41cc3e7c11c8 (patch) | |
tree | d5cf03877443f10c2d0846533fdad64ede925073 /error.c | |
parent | a4d687f1c76874623e5a239279ca1d7886697abc (diff) | |
download | ruby-ab6963043df202bde77d67dfabff41cc3e7c11c8.tar.gz |
* 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
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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); |