Open
Conversation
BlackBean99
reviewed
May 23, 2024
Comment on lines
+22
to
+39
| allApplicantNum.put("PG", 0); | ||
| allApplicantNum.put("PM", 0); | ||
| allApplicantNum.put("DE", 0); | ||
|
|
||
| // value = Registration | ||
| for (String key : allRegistration.keySet()){ | ||
| Registration registration = allRegistration.get(key); | ||
| allApplicantNum.put(registration.getHopeField(), allApplicantNum.get(registration.getHopeField()) + 1); | ||
| } | ||
|
|
||
| // WEB, APP, AI, GAME | ||
| // key = firstPriority, secondPriority | ||
| Map<String, int[]> allApplicantPriority = new HashMap<>(); | ||
|
|
||
| allApplicantPriority.put("WEB", new int[2]); | ||
| allApplicantPriority.put("APP", new int[2]); | ||
| allApplicantPriority.put("AI", new int[2]); | ||
| allApplicantPriority.put("GAME", new int[2]); |
Collaborator
There was a problem hiding this comment.
put put put put 해서 메소드 하나에 별도로 인덱스를 접근해서 초기화 하는 코드 하나로 지금 거의 10줄이 넘게 소요되고 있죠? 차라리 init 함수를 따로 빼도 좋겠습니다.
Comment on lines
+42
to
+51
| for (String key : allRegistration.keySet()){ | ||
| Registration registration = allRegistration.get(key); | ||
| int[] firstPriority = allApplicantPriority.get(registration.getFirstPriority()); | ||
| int[] secondPriority = allApplicantPriority.get(registration.getSecondPriority()); | ||
|
|
||
| firstPriority[0] += 1; | ||
| secondPriority[1] += 1; | ||
|
|
||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
1씩 늘려가며 집계하는 코드는 좋지 않습니다. 나중에 100만건이 있으면 100만번 더하는 것이 좋을까요? 다시 고민!
Comment on lines
+31
to
+43
| if(!allMajor.containsKey(major)){ | ||
| allMajor.put(major, 0); | ||
| } | ||
| if(!allMajor.containsKey(doubleMajor)){ | ||
| allMajor.put(doubleMajor, 0); | ||
| } | ||
| if(!allMajor.containsKey(minor)){ | ||
| allMajor.put(minor, 0); | ||
| } | ||
|
|
||
| allMajor.put(major, allMajor.get(major) + 1); | ||
| allMajor.put(doubleMajor, allMajor.get(doubleMajor) + 1); | ||
| allMajor.put(minor, allMajor.get(minor) + 1); |
Collaborator
There was a problem hiding this comment.
르블랑의 법칙
나는 현재 충분히 아름다운 코드를 짜고 있는가?
우리 모두는 자신이 짠 쓰레기 코드를 쳐다보며 나중에 손보겠다고 생각한 경험이 있다. 우리 모두는 대충 짠 프로그램이 돌아간다는 사실에 안도감을 느끼며 그래도 안 돌아가는 프로그램보다 돌아가는 쓰레기가 좋다고 스스로를 위로한 경험이 있다. 다시 돌아와 나중에 정리하겠다고 다짐했었다. 물론 그때 그 시절 우리는 르블랑의 법칙을 몰랐다. 나중은 결코 오지 않는다.
LJH098
reviewed
May 23, 2024
Comment on lines
+15
to
+24
| public DesiredTimeMapper getAllDesiredTime() { | ||
| Map<String, DesiredTime> allDesiredTime = db.getAllDesiredTime(); | ||
| for (String key : allDesiredTime.keySet()){ | ||
| DesiredTime desiredTime = allDesiredTime.get(key); | ||
| for (int[] times: desiredTime.getDesiredTime()){ | ||
| int startTime = times[0]; | ||
| int endTime = times[1]; | ||
|
|
||
|
|
||
| } |
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.
No description provided.