Skip to content

Commit

Permalink
fix: PointScore parallelStream -> forEach
Browse files Browse the repository at this point in the history
  • Loading branch information
suw0n committed Apr 15, 2024
1 parent e13cab5 commit 8360805
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ private void savePoints(List<Student> students, PointReason reason, LocalDate is
}

private void saveScores(List<Student> students, PointReason reason) {
pointService.getScoresBy(students).parallelStream()
.map(s -> s.issue(reason));
pointService.getScoresBy(students).forEach(
s -> s.issue(reason)
);
}

private void publishPointIssuedEvents(List<Student> students, PointReason reason) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ public PointScore(Student student) {
this.student = student;
}

public boolean issue(PointReason reason) {
public void issue(PointReason reason) {
switch (reason.getPointType()) {
case DORMITORY -> dormitoryScore.issue(reason.getScoreType(), reason.getScore());
case SCHOOL -> schoolScore.issue(reason.getScoreType(), reason.getScore());
}
return true;
}

public void cancel(PointReason reason) {
Expand Down

0 comments on commit 8360805

Please sign in to comment.