Skip to content

Instantly share code, notes, and snippets.

@headius
Created June 1, 2018 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/7296808402fd2fae496310cf0baa7239 to your computer and use it in GitHub Desktop.
Save headius/7296808402fd2fae496310cf0baa7239 to your computer and use it in GitHub Desktop.
[] ~/projects/jruby $ jruby -e 'p 2147483648.times.count'
2147483648
[] ~/projects/jruby $ git diff
diff --git a/core/src/main/java/org/jruby/RubyEnumerable.java b/core/src/main/java/org/jruby/RubyEnumerable.java
index 80979c8088..66a48cfa95 100644
--- a/core/src/main/java/org/jruby/RubyEnumerable.java
+++ b/core/src/main/java/org/jruby/RubyEnumerable.java
@@ -160,7 +160,7 @@ public class RubyEnumerable {
private static IRubyObject countCommon(ThreadContext context, IRubyObject self, final Block block) {
final Ruby runtime = context.runtime;
- final int result[] = new int[] { 0 };
+ final long result[] = new long[] { 0 };
if (block.isGiven()) {
each(context, self, new JavaInternalBlockBody(runtime, context, "Enumerable#count", block.getSignature()) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment