@@ -2285,7 +2285,6 @@ ary_join_0(VALUE ary, VALUE sep, long max, VALUE result)
2285
2285
if (i > 0 && !NIL_P (sep ))
2286
2286
rb_str_buf_append (result , sep );
2287
2287
rb_str_buf_append (result , val );
2288
- if (OBJ_TAINTED (val )) OBJ_TAINT (result );
2289
2288
}
2290
2289
}
2291
2290
@@ -2346,11 +2345,9 @@ VALUE
2346
2345
rb_ary_join (VALUE ary , VALUE sep )
2347
2346
{
2348
2347
long len = 1 , i ;
2349
- int taint = FALSE;
2350
2348
VALUE val , tmp , result ;
2351
2349
2352
2350
if (RARRAY_LEN (ary ) == 0 ) return rb_usascii_str_new (0 , 0 );
2353
- if (OBJ_TAINTED (ary )) taint = TRUE;
2354
2351
2355
2352
if (!NIL_P (sep )) {
2356
2353
StringValue (sep );
@@ -2364,7 +2361,6 @@ rb_ary_join(VALUE ary, VALUE sep)
2364
2361
int first ;
2365
2362
result = rb_str_buf_new (len + (RARRAY_LEN (ary )- i )* 10 );
2366
2363
rb_enc_associate (result , rb_usascii_encoding ());
2367
- if (taint ) OBJ_TAINT (result );
2368
2364
ary_join_0 (ary , sep , i , result );
2369
2365
first = i == 0 ;
2370
2366
ary_join_1 (ary , ary , sep , i , result , & first );
@@ -2377,7 +2373,6 @@ rb_ary_join(VALUE ary, VALUE sep)
2377
2373
result = rb_str_new (0 , len );
2378
2374
rb_str_set_len (result , 0 );
2379
2375
2380
- if (taint ) OBJ_TAINT (result );
2381
2376
ary_join_0 (ary , sep , RARRAY_LEN (ary ), result );
2382
2377
2383
2378
return result ;
@@ -2419,21 +2414,18 @@ rb_ary_join_m(int argc, VALUE *argv, VALUE ary)
2419
2414
static VALUE
2420
2415
inspect_ary (VALUE ary , VALUE dummy , int recur )
2421
2416
{
2422
- int tainted = OBJ_TAINTED (ary );
2423
2417
long i ;
2424
2418
VALUE s , str ;
2425
2419
2426
2420
if (recur ) return rb_usascii_str_new_cstr ("[...]" );
2427
2421
str = rb_str_buf_new2 ("[" );
2428
2422
for (i = 0 ; i < RARRAY_LEN (ary ); i ++ ) {
2429
2423
s = rb_inspect (RARRAY_AREF (ary , i ));
2430
- if (OBJ_TAINTED (s )) tainted = TRUE;
2431
2424
if (i > 0 ) rb_str_buf_cat2 (str , ", " );
2432
2425
else rb_enc_copy (str , s );
2433
2426
rb_str_buf_append (str , s );
2434
2427
}
2435
2428
rb_str_buf_cat2 (str , "]" );
2436
- if (tainted ) OBJ_TAINT (str );
2437
2429
return str ;
2438
2430
}
2439
2431
@@ -4135,8 +4127,6 @@ rb_ary_times(VALUE ary, VALUE times)
4135
4127
}
4136
4128
}
4137
4129
out :
4138
- OBJ_INFECT (ary2 , ary );
4139
-
4140
4130
return ary2 ;
4141
4131
}
4142
4132
@@ -5315,7 +5305,6 @@ rb_ary_flatten(int argc, VALUE *argv, VALUE ary)
5315
5305
if (result == ary ) {
5316
5306
result = ary_make_shared_copy (ary );
5317
5307
}
5318
- OBJ_INFECT (result , ary );
5319
5308
5320
5309
return result ;
5321
5310
}
0 commit comments