Skip to content

Commit

Permalink
Fixes #2902. Enumerable#find_index gives wrong result in case with ty…
Browse files Browse the repository at this point in the history
…pes cast
  • Loading branch information
enebo committed May 1, 2015
1 parent d58fd29 commit 5dc447a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/RubyEnumerable.java
Expand Up @@ -54,6 +54,7 @@

import static org.jruby.RubyEnumerator.enumeratorize;
import static org.jruby.RubyEnumerator.enumeratorizeWithSize;
import static org.jruby.RubyObject.equalInternal;
import static org.jruby.runtime.Helpers.invokedynamic;
import static org.jruby.runtime.invokedynamic.MethodNames.OP_CMP;
import static org.jruby.RubyEnumerator.SizeFn;
Expand Down Expand Up @@ -717,7 +718,7 @@ public static IRubyObject find_indexCommon(ThreadContext context, IRubyObject se
callEach(runtime, context, self, Signature.ONE_ARGUMENT, new BlockCallback() {
public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) {
IRubyObject larg = packEnumValues(runtime, largs);
if (larg.equals(cond)) throw JumpException.SPECIAL_JUMP;
if (equalInternal(ctx, larg, cond)) throw JumpException.SPECIAL_JUMP;
result[0]++;
return runtime.getNil();
}
Expand Down

0 comments on commit 5dc447a

Please sign in to comment.