mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	load.c: use fstring instead of OBJ_FREEZE
These strings already exist (or will exist soon) in the fstring table, so avoid the duplicate, sooner. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									7e669f40be
								
							
						
					
					
						commit
						7c8b79755b
					
				
					 1 changed files with 3 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -661,7 +661,7 @@ load_encoding(const char *name)
 | 
			
		|||
	++s;
 | 
			
		||||
    }
 | 
			
		||||
    FL_UNSET(enclib, FL_TAINT);
 | 
			
		||||
    OBJ_FREEZE(enclib);
 | 
			
		||||
    enclib = rb_fstring(enclib);
 | 
			
		||||
    ruby_verbose = Qfalse;
 | 
			
		||||
    ruby_debug = Qfalse;
 | 
			
		||||
    errinfo = rb_errinfo();
 | 
			
		||||
| 
						 | 
				
			
			@ -1162,8 +1162,7 @@ enc_names_i(st_data_t name, st_data_t idx, st_data_t args)
 | 
			
		|||
    VALUE *arg = (VALUE *)args;
 | 
			
		||||
 | 
			
		||||
    if ((int)idx == (int)arg[0]) {
 | 
			
		||||
	VALUE str = rb_usascii_str_new2((char *)name);
 | 
			
		||||
	OBJ_FREEZE(str);
 | 
			
		||||
	VALUE str = rb_fstring_cstr((char *)name);
 | 
			
		||||
	rb_ary_push(arg[1], str);
 | 
			
		||||
    }
 | 
			
		||||
    return ST_CONTINUE;
 | 
			
		||||
| 
						 | 
				
			
			@ -1697,8 +1696,7 @@ rb_enc_aliases_enc_i(st_data_t name, st_data_t orig, st_data_t arg)
 | 
			
		|||
	str = rb_fstring_cstr(rb_enc_name(enc));
 | 
			
		||||
	rb_ary_store(ary, idx, str);
 | 
			
		||||
    }
 | 
			
		||||
    key = rb_usascii_str_new2((char *)name);
 | 
			
		||||
    OBJ_FREEZE(key);
 | 
			
		||||
    key = rb_fstring_cstr((char *)name);
 | 
			
		||||
    rb_hash_aset(aliases, key, str);
 | 
			
		||||
    return ST_CONTINUE;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue