Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step3. 3단계 - 로또(2등) #1125

Merged
merged 13 commits into from
Dec 17, 2020
Merged

Conversation

byungkyu-ju
Copy link

No description provided.

Copy link

@hongsii hongsii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이전 단계에서부터 구조를 잘 잡으셔서 큰 변경없이 요구사항을 구현하셨네요! 👍
간단한 피드백 남겼으니 다음 단계에서 함께 반영해주세요!

(oldValue, newValue) -> oldValue, LinkedHashMap::new));
private List<Prize> awards(LottoTickets userLottoTickets, WinningLottoTicket winnerLottoTicket) {
return userLottoTickets.getLottoTickets().stream()
.map(lottoTicket -> matchTicketToPrize(lottoTicket, winnerLottoTicket))
Copy link

@hongsii hongsii Dec 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

필드를 지닌 객체를 통해 로직이 처리되도록 winnerLottoTicket 로 메시지를 보내도록 바꿔보면 어떨까요?

Prize prize = winnerLottoTicket.match(lottoTicket)

Comment on lines +28 to +29
return Arrays.stream(values()).filter(prize -> prize.isEqualMatchCount(count))
.filter(prize -> !prize.equals(SECOND) || isMatchBonus)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stream은 한 줄에 하나의 처리만 하도록 구현하면 가독성을 향상시킬 수 있습니다.

Suggested change
return Arrays.stream(values()).filter(prize -> prize.isEqualMatchCount(count))
.filter(prize -> !prize.equals(SECOND) || isMatchBonus)
return Arrays.stream(values())
.filter(prize -> prize.isEqualMatchCount(count))
.filter(prize -> !prize.equals(SECOND) || isMatchBonus)

@hongsii hongsii merged commit add3718 into next-step:byungkyu-ju Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants