Skip to content

Commit

Permalink
Merge pull request #455 from ocoanet/master
Browse files Browse the repository at this point in the history
Use Util.getSequencesFor to create sequences from processors
  • Loading branch information
Palmr authored Jul 5, 2023
2 parents 87156a0 + f164d9f commit b29b8fd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/java/com/lmax/disruptor/dsl/Disruptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,11 @@ public EventHandlerGroup<T> handleEventsWith(final EventProcessor... processors)
consumerRepository.add(processor);
}

final Sequence[] sequences = new Sequence[processors.length];
for (int i = 0; i < processors.length; i++)
{
sequences[i] = processors[i].getSequence();
}
final Sequence[] sequences = Util.getSequencesFor(processors);

ringBuffer.addGatingSequences(sequences);

return new EventHandlerGroup<>(this, consumerRepository, Util.getSequencesFor(processors));
return new EventHandlerGroup<>(this, consumerRepository, sequences);
}


Expand Down

0 comments on commit b29b8fd

Please sign in to comment.