Skip to content

Commit

Permalink
Refactor getFoedested and getFoedselsdato functions
Browse files Browse the repository at this point in the history
Remove unnecessary `utenHistorikk` method call from `getFoedested` and `getFoedselsdato` functions. This streamlines the logic by directly returning the mapped list when relevant data is unavailable.
  • Loading branch information
krharum committed Sep 9, 2024
1 parent 5dc7b23 commit 7d1eec4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,15 @@ private List<? extends DbVersjonDTO> utenHistorikk(List<? extends DbVersjonDTO>

private List<? extends DbVersjonDTO> getFoedested(PersonDTO person) {

return utenHistorikk(!person.getFoedested().isEmpty() ?
return !person.getFoedested().isEmpty() ?
person.getFoedested() :
mapperFacade.mapAsList(person.getFoedsel(), FoedestedDTO.class));
mapperFacade.mapAsList(person.getFoedsel(), FoedestedDTO.class);
}

private List<? extends DbVersjonDTO> getFoedselsdato(PersonDTO person) {

return utenHistorikk(!person.getFoedselsdato().isEmpty() ?
return !person.getFoedselsdato().isEmpty() ?
person.getFoedselsdato() :
mapperFacade.mapAsList(person.getFoedsel(), FoedselDTO.class));
mapperFacade.mapAsList(person.getFoedsel(), FoedselDTO.class);
}
}

0 comments on commit 7d1eec4

Please sign in to comment.