From 5b56705ceac6502185742c38b4d665f697d8ad47 Mon Sep 17 00:00:00 2001 From: weonest Date: Wed, 27 Dec 2023 14:47:31 +0900 Subject: [PATCH] =?UTF-8?q?:recycle:=20=EC=8A=A4=ED=85=8C=EB=94=94=20?= =?UTF-8?q?=ED=8F=AC=EC=A7=80=EC=85=98=20=EC=83=9D=EC=84=B1=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../steady/steady/service/SteadyService.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/dev/steady/steady/service/SteadyService.java b/src/main/java/dev/steady/steady/service/SteadyService.java index 84e8497..8622169 100644 --- a/src/main/java/dev/steady/steady/service/SteadyService.java +++ b/src/main/java/dev/steady/steady/service/SteadyService.java @@ -237,19 +237,16 @@ private Stack getStack(Long stackId) { private List createSteadyPositions(List positions, Steady steady) { return IntStream.range(0, positions.size()) - .mapToObj(index -> createSteadyPosition(positions, steady, index)) + .mapToObj(index -> { + Position position = positionRepository.getById(positions.get(index)); + return SteadyPosition.builder() + .position(position) + .steady(steady) + .build(); + }) .toList(); } - private SteadyPosition createSteadyPosition(List positions, Steady steady, int index) { - Position position = positionRepository.getById(positions.get(index)); - - return SteadyPosition.builder() - .position(position) - .steady(steady) - .build(); - } - private List createSteadyQuestions(List questions, Steady steady) { return IntStream.range(0, questions.size()) .mapToObj(index -> SteadyQuestion.builder()