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

* file.c (rb_file_s_expand_path): avoid calling rb_scan_args() for

apparent cases. [ruby-talk:79748]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-08-23 17:06:55 +00:00
parent 8211f8f8af
commit 9942c6ed13
3 changed files with 11 additions and 5 deletions

View file

@ -3,6 +3,11 @@ Sun Aug 24 01:02:48 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (file_expand_path): performance improvement.
[ruby-talk:79748]
Sat Aug 23 23:41:16 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* file.c (rb_file_s_expand_path): avoid calling rb_scan_args() for
apparent cases. [ruby-talk:79748]
Sat Aug 23 18:56:53 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/nkf/nkf.c (rb_nkf_putchar): should use rb_str_resize() to just

7
eval.c
View file

@ -4256,16 +4256,13 @@ VALUE
rb_yield_splat(values)
VALUE values;
{
VALUE tmp;
int avalue = Qfalse;
tmp = rb_check_array_type(values);
if (!NIL_P(tmp)) {
if (RARRAY(tmp)->len == 0) {
if (TYPE(values) == T_ARRAY) {
if (RARRAY(values)->len == 0) {
values = Qundef;
}
else {
values = tmp;
avalue = Qtrue;
}
}

4
file.c
View file

@ -1758,6 +1758,10 @@ rb_file_s_expand_path(argc, argv)
VALUE *argv;
{
VALUE fname, dname;
if (argc == 1) {
return rb_file_expand_path(argv[0], Qnil);
}
rb_scan_args(argc, argv, "11", &fname, &dname);
return rb_file_expand_path(fname, dname);