I'm trying to create a hash from an array and the documentation for http://ruby-doc.org/ruby-1.9/classes/Array.src/M000744.html shows an internal ruby method called ary_make_hash. The source uses this to diff arrays. The relevant line in the source is: ary_make_hash(to_ary(ary2), 0);
Is there a way to access the ary_make_hash function and other internal Ruby functions from inside Ruby? I ask since I'm trying to convert a huge array to a hash and I'd love to use the built in C methods since they're so much faster. (FYI I can see the speed difference by subtracting two arrays, which internally invokes the converter method). Thanks for any thoughts.
Robert
in general if it's not in ruby.h, then it's not a "public" api looking for a method called rb_xxx might also help. GL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With