Skip to content

Commit

Permalink
refactor: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
stawirej committed Jan 1, 2024
1 parent a4ad048 commit dbc8434
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static pl.amazingcode.threadscollider.ThreadFactory.THREAD_FACTORY;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CountDownLatch;
Expand Down Expand Up @@ -56,10 +55,8 @@ private ThreadsCollider(
public void collide() {

try {
Iterator<Action> actionIterator = actions.iterator();

while (actionIterator.hasNext()) {
Action action = actionIterator.next();
for (Action action : actions) {
for (int i = 0; i < action.times(); i++) {
executor.execute(() -> decorate(action));
}
Expand Down

0 comments on commit dbc8434

Please sign in to comment.