Skip to content

Conversation

soyeon207
Copy link
Owner

@soyeon207 soyeon207 commented Apr 28, 2022

PR 테스트 코드 추가

어떤거어떤거 확인 부탁 드립니다

@soyeon207 soyeon207 self-assigned this Apr 28, 2022
@soyeon207 soyeon207 added the bug Something isn't working label Apr 28, 2022
Copy link
Owner Author

@soyeon207 soyeon207 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다

Comment on lines +56 to +62
List<String> userEmailList = new ArrayList<>();

List<UserDTO> userDTOList = usersService.findAll();
for (UserDTO userDTO : userDTOList) {
userEmailList.add(userDTO.getEmail());
}
return userEmailList;
Copy link
Owner Author

Choose a reason for hiding this comment

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

여기 stream 을 사용하면 어떨까요 ??

Suggested change
List<String> userEmailList = new ArrayList<>();
List<UserDTO> userDTOList = usersService.findAll();
for (UserDTO userDTO : userDTOList) {
userEmailList.add(userDTO.getEmail());
}
return userEmailList;
userEmailList.findAll().stream().map(UserDTO::getEmail).collect(Collectors.toList());

위처럼 더 가독성이 좋게 사용할 수 있을 것 같습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant