Skip to content

Commit

Permalink
refactor: 불필요한 Map 반복문 삭제제
Browse files Browse the repository at this point in the history
  • Loading branch information
ImxYJL committed Dec 13, 2024
1 parent 567b119 commit d5947ae
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,8 @@ const useMultipleChoice = ({ question, handleModalOpen }: UseMultipleChoiceProps
const findSelectedOptionIds = ({ answerMap, questionId }: FindSelectedOptionIdsParams) => {
if (!answerMap) return null;

for (const [, value] of answerMap) {
if (value.questionId === questionId) {
return value.selectedOptionIds;
}
}
return null;
const selectedItem = answerMap.get(questionId);
return selectedItem ? selectedItem.selectedOptionIds : null;
};

// 저장된 객관식 답변이 있다면 복원
Expand Down

0 comments on commit d5947ae

Please sign in to comment.