Что быстрее: Set или List? [закрыто] ⇐ JAVA
Что быстрее: Set или List? [закрыто]
In my current situation I'm using a Set to not have any duplicates, but was wondering what is faster, Set or List?
Set sentEmails = drawingParticipants.stream() .map(participant -> participant.getParticipant().getEmail()) .collect(Collectors.toSet()); List sentEmails = drawingParticipants.stream() .map(participant -> participant.getParticipant().getEmail()) .toList(); Which should I use and why?
Источник: https://stackoverflow.com/questions/781 ... liststring
In my current situation I'm using a Set to not have any duplicates, but was wondering what is faster, Set or List?
Set sentEmails = drawingParticipants.stream() .map(participant -> participant.getParticipant().getEmail()) .collect(Collectors.toSet()); List sentEmails = drawingParticipants.stream() .map(participant -> participant.getParticipant().getEmail()) .toList(); Which should I use and why?
Источник: https://stackoverflow.com/questions/781 ... liststring
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение