@@ -182,6 +182,7 @@ VALUE cASN1Sequence, cASN1Set; /* CONSTRUCTIVE */
182182static VALUE sym_IMPLICIT , sym_EXPLICIT ;
183183static VALUE sym_UNIVERSAL , sym_APPLICATION , sym_CONTEXT_SPECIFIC , sym_PRIVATE ;
184184static ID sivVALUE , sivTAG , sivTAG_CLASS , sivTAGGING , sivINFINITE_LENGTH , sivUNUSED_BITS ;
185+ static ID id_each ;
185186
186187/*
187188 * Ruby to ASN1 converters
@@ -696,7 +697,7 @@ static VALUE
696697join_der (VALUE enumerable )
697698{
698699 VALUE str = rb_str_new (0 , 0 );
699- rb_block_call (enumerable , rb_intern ( "each" ) , 0 , 0 , join_der_i , str );
700+ rb_block_call (enumerable , id_each , 0 , 0 , join_der_i , str );
700701 return str ;
701702}
702703
@@ -1284,7 +1285,8 @@ ossl_asn1cons_to_der(VALUE self)
12841285static VALUE
12851286ossl_asn1cons_each (VALUE self )
12861287{
1287- rb_ary_each (ossl_asn1_get_value (self ));
1288+ rb_funcall (ossl_asn1_get_value (self ), id_each , 0 );
1289+
12881290 return self ;
12891291}
12901292
@@ -1925,4 +1927,6 @@ do{\
19251927 rb_hash_aset (class_tag_map , cASN1UniversalString , INT2NUM (V_ASN1_UNIVERSALSTRING ));
19261928 rb_hash_aset (class_tag_map , cASN1BMPString , INT2NUM (V_ASN1_BMPSTRING ));
19271929 rb_global_variable (& class_tag_map );
1930+
1931+ id_each = rb_intern_const ("each" );
19281932}
0 commit comments