Skip to content

Commit

Permalink
refactor: 코드 간결하게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuny0310 committed Oct 29, 2023
1 parent 68e1675 commit 91bba57
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.ssafy.ssafsound.domain.post.dto;

import com.ssafy.ssafsound.domain.board.domain.Board;
import com.ssafy.ssafsound.domain.comment.domain.Comment;
import com.ssafy.ssafsound.domain.post.domain.Post;
import com.ssafy.ssafsound.domain.post.domain.PostImage;
import lombok.AllArgsConstructor;
Expand All @@ -11,7 +10,6 @@

import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;

@Getter
@Builder
Expand Down Expand Up @@ -48,9 +46,7 @@ public GetPostElement(Post post) {
}

private int getCommentSize(Post post) {
List<Comment> comments = post.getComments();

return (int) comments.stream()
return (int) post.getComments().stream()
.filter(comment -> !comment.getDeletedComment()).count();
}

Expand Down

0 comments on commit 91bba57

Please sign in to comment.