[前][次][番号順一覧][スレッド一覧]

ruby-changes:46392

From: normal <ko1@a...>
Date: Sat, 29 Apr 2017 19:51:06 +0900 (JST)
Subject: [ruby-changes:46392] normal:r58506 (trunk): load.c: remove a redundant rb_str_freeze call

normal	2017-04-29 19:50:59 +0900 (Sat, 29 Apr 2017)

  New Revision: 58506

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58506

  Log:
    load.c: remove a redundant rb_str_freeze call
    
    rb_file_expand_path_fast already performs the buffer shrinking
    rb_str_freeze does (via expand_path macro in file.c); the
    result of rb_fstring is always frozen, and that rb_fstring
    call is the last use of `expanded_path` in its scope.
    
    load.c (rb_construct_expanded_load_path): remove rb_str_freeze

  Modified files:
    trunk/load.c
Index: load.c
===================================================================
--- load.c	(revision 58505)
+++ load.c	(revision 58506)
@@ -86,7 +86,6 @@ rb_construct_expanded_load_path(enum exp https://github.com/ruby/ruby/blob/trunk/load.c#L86
 	    rb_str_freeze(path);
 	as_str = rb_get_path_check_convert(path, as_str, level);
 	expanded_path = rb_file_expand_path_fast(as_str, Qnil);
-	rb_str_freeze(expanded_path);
 	rb_ary_push(ary, rb_fstring(expanded_path));
     }
     rb_obj_freeze(ary);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]