Skip to content

Commit

Permalink
refactor: findNear 필터 성능개선
Browse files Browse the repository at this point in the history
  • Loading branch information
ehtjsv2 committed Aug 6, 2024
1 parent 9289872 commit 41b7ac3
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ public List<FindNearFootprintResponse> findNear(Long memberId, FindNearFootprint
Location currentLocation = new Location(request.latitude(), request.longitude());

return recentFootprints.stream()
.filter(footprint -> footprint.isNear(currentLocation))
.filter(footprint -> !footprint.isDeleted())
.filter(footprint -> footprint.isNear(currentLocation) && !footprint.isDeleted())
.map(footprint -> new FindNearFootprintResponse(footprint, footprint.isCreatedBy(memberId)))
.toList();
}
Expand Down

0 comments on commit 41b7ac3

Please sign in to comment.