Skip to content

Commit

Permalink
Fix visitLimited for concurrency (marshalTo and marshalFrom)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBr committed Aug 4, 2018
1 parent ab40019 commit fc561b1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions core/src/main/java/org/jruby/RubyHash.java
Expand Up @@ -880,17 +880,13 @@ private <T> void visitLimited(ThreadContext context, VisitorWithState visitor, l
long count = size;
int index = 0;
IRubyObject key, value;
for (int i = start; i < end; i++) {
key = entries[i * NUMBER_OF_ENTRIES];
value = entries[(i * NUMBER_OF_ENTRIES) + 1];
for (int i = start; i < end && count != 0; i++) {
if (startGeneration != generation) {
startGeneration = generation;
key = entries[start * NUMBER_OF_ENTRIES];
value = entries[(start * NUMBER_OF_ENTRIES) + 1];
i = 0;
if (start == 0 || start == 1)
break;
i = start;
}
key = entries[i * NUMBER_OF_ENTRIES];
value = entries[(i * NUMBER_OF_ENTRIES) + 1];

if(key == null || value == null)
continue;
Expand Down

0 comments on commit fc561b1

Please sign in to comment.