Skip to content

Commit e284994

Browse files
committed
♻️ refactor : 단순한 조건문 return문으로
1 parent 4b42ee8 commit e284994

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

backend/src/main/java/io/f1/backend/domain/game/app/GameService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private Integer checkGameSetting(Room room, Long quizId) {
7272

7373
GameSetting gameSetting = room.getGameSetting();
7474

75-
if (!gameSetting.checkQuizId(quizId)) {
75+
if (!gameSetting.validateQuizId(quizId)) {
7676
throw new CustomException(GameErrorCode.GAME_SETTING_CONFLICT);
7777
}
7878

backend/src/main/java/io/f1/backend/domain/game/model/GameSetting.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ public class GameSetting {
1111
private Integer round; // 게임 변경 시 해당 게임의 총 문제 수로 설정
1212
private int timeLimit = 60;
1313

14-
public boolean checkQuizId(Long quizId) {
15-
if (this.quizId != null && this.quizId.equals(quizId)) {
16-
return true;
17-
}
18-
return false;
14+
public boolean validateQuizId(Long quizId) {
15+
return this.quizId != null && this.quizId.equals(quizId);
1916
}
2017
}

0 commit comments

Comments
 (0)