Skip to content

Commit

Permalink
Get rid of env_data_type
Browse files Browse the repository at this point in the history
Defining `ENV` as a T_DATA doesn't give us anything.
  • Loading branch information
byroot committed Nov 21, 2023
1 parent f5c3cda commit 4c63237
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -6597,17 +6597,6 @@ env_dup(VALUE obj)
rb_raise(rb_eTypeError, "Cannot dup ENV, use ENV.to_h to get a copy of ENV as a hash");
}

static const rb_data_type_t env_data_type = {
"ENV",
{
NULL,
NULL,
NULL,
NULL,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
};

/*
* A \Hash maps each of its unique keys to a specific value.
*
Expand Down Expand Up @@ -7354,7 +7343,7 @@ Init_Hash(void)
* envtbl = rb_define_class("ENV", rb_cObject);
*/
origenviron = environ;
envtbl = TypedData_Wrap_Struct(rb_cObject, &env_data_type, NULL);
envtbl = rb_obj_alloc(rb_cObject);
rb_extend_object(envtbl, rb_mEnumerable);
FL_SET_RAW(envtbl, RUBY_FL_SHAREABLE);

Expand Down

0 comments on commit 4c63237

Please sign in to comment.