Open
Conversation
moongua404
reviewed
May 19, 2025
Contributor
moongua404
left a comment
There was a problem hiding this comment.
5주차 미션 수고하셨습니다!
다음에는 패키지도 활용해보시면 좋을 것 같아요
| sum = safeAdd(sum, value); | ||
| } | ||
| return sum; | ||
| } |
Contributor
There was a problem hiding this comment.
함수 볼륨이 좀 큰 것 같아요.
예외 처리 로직, 구분자 추출 로직, 연산 로직 이렇게 기능이 분리될 수 있으면 함수도 분리하는게 맞다고 생각합니다.
| throw new IllegalArgumentException("오버플로우 발생"); | ||
| } | ||
| return result; | ||
| } |
Contributor
There was a problem hiding this comment.
오버플로우를 검출하며 계산하는 Math.addExact 라는 함수를 활용할 수 있을 것 같아요
| if (custom.length() > 1) throw new IllegalArgumentException("구분자는 한 문자여야 합니다."); | ||
| delimiter = Pattern.quote(custom); | ||
| input = input.substring(newlineIdx + 2); | ||
| } |
Contributor
There was a problem hiding this comment.
이 부분도 regex를 사용하면 가독성이나 효율성 측면에서 더 좋을 것 같아요
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
오류가 나서 GPT한테 물어보니 build.gradle 파일을 수정이 필요하다고 해서 수정했습니다.