Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add faster versions of `equals` and `is_equal` #107
I'm just getting my feet wet with Rust/Rutie, so its entirely possible that this patch is nonsensical. Also, I'm not sure if I have put things in the right place, etc. Happy to make any changes you consider necessary!
First, because Ruby < 2.5 has a different implementation of
I'm hesitant to allow Ruby versioning for different code paths. Once you travel down this road it grows into an unmaintainable beast. I have some code commented out in Rutie waiting for "End of Life" (our own EOL timing, not Ruby's… see below) of older Ruby versions before I can use Ruby's
Once Ruby 2.7 comes out we can stop officially supporting 2.4 as we only support the 3 most recent versions of Ruby. Then you won't need this Ruby version check. So you just need to wait until Christmas for adding this new implementation… or work with a fork of this project until then.
- `Object::equals` is now a wrapper around the `rb_equal` C function; - `Object::is_equal` simply performs an `==` comparison on the underlying values, which is the same behaviour as the `rb_obj_equal` C function.