Skip to content

Commit

Permalink
refactor: null 결과값 상수화 및 early return 리팩터링 (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
gardening-y committed Mar 7, 2024
1 parent 8dd127b commit be1e9d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions doorip-api/src/main/java/org/doorip/common/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ public abstract class Constants {
public static final int MAX_PARTICIPANT_COUNT = 6;
public static final int MIN_PARTICIPANT_COUNT = 1;
public static final int TODO_OWNER_POSITION = 0;
public static final int USER_RESULT_NULL = -1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,8 @@ private boolean isEqualUserAndParticipantUser(User user, User participantUser) {

private int getValidatedResult(User user) {
if (user.getResult() == null) {
return -1;
}
else {
return user.getResult().getNumResult();
return USER_RESULT_NULL;
}
return user.getResult().getNumResult();
}
}

0 comments on commit be1e9d1

Please sign in to comment.