Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Improve performance of the Equals operator in the RubyComparable class for objects of different types #330

merged 1 commit into from

3 participants

Kamil Bednarz Kevin Menard Charles Oliver Nutter
Kamil Bednarz

Please see the following ticket for all the details:

Charles Oliver Nutter headius merged commit e2c3728 into from
Kevin Menard

Mind converting the tabs to spaces for consistency?

Kamil Bednarz


Thanks for your remark.
I created a pull request, that fixes the indentation: #337

BTW, I deleted my previous message - I misunderstood you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 2, 2012
  1. Kamil Bednarz

    Added workaround to prevent throwing exceptions when using == operato…

    kamilbednarz authored
    …r on objects of different types.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/org/jruby/
5 src/org/jruby/
@@ -116,6 +116,11 @@ private static IRubyObject callCmpMethod(ThreadContext context, IRubyObject recv
try {
IRubyObject result = invokedynamic(context, recv, OP_CMP, other);
+ // This is only to prevent throwing exceptions by cmperr - it has poor performance
+ if (result.isNil()) {
+ return returnValueOnError;
+ }
return RubyBoolean.newBoolean(runtime, cmpint(context, result, recv, other) == 0);
} catch (RaiseException e) {
if (e.getException().kind_of_p(context, runtime.getStandardError()).isTrue()) {
Something went wrong with that request. Please try again.