Use toList() Stream method

This commit is contained in:
AsamK 2022-07-07 18:22:09 +02:00
parent f4346e3f0a
commit dcde9fbe8e

View file

@ -51,7 +51,6 @@ import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
public class SendHelper { public class SendHelper {
@ -275,7 +274,7 @@ public class SendHelper {
.getDevices() .getDevices()
.stream() .stream()
.map(device -> new SignalProtocolAddress(address.getIdentifier(), device)) .map(device -> new SignalProtocolAddress(address.getIdentifier(), device))
.collect(Collectors.toList()); .toList();
account.getSenderKeyStore().markSenderKeySharedWith(group.getDistributionId(), addresses); account.getSenderKeyStore().markSenderKeySharedWith(group.getDistributionId(), addresses);
} }
@ -536,14 +535,14 @@ public class SendHelper {
List<SignalServiceAddress> addresses = recipientIdList.stream() List<SignalServiceAddress> addresses = recipientIdList.stream()
.map(context.getRecipientHelper()::resolveSignalServiceAddress) .map(context.getRecipientHelper()::resolveSignalServiceAddress)
.collect(Collectors.toList()); .toList();
List<UnidentifiedAccess> unidentifiedAccesses = context.getUnidentifiedAccessHelper() List<UnidentifiedAccess> unidentifiedAccesses = context.getUnidentifiedAccessHelper()
.getAccessFor(recipientIdList) .getAccessFor(recipientIdList)
.stream() .stream()
.map(Optional::get) .map(Optional::get)
.map(UnidentifiedAccessPair::getTargetUnidentifiedAccess) .map(UnidentifiedAccessPair::getTargetUnidentifiedAccess)
.map(Optional::get) .map(Optional::get)
.collect(Collectors.toList()); .toList();
try { try {
List<SendMessageResult> results = sender.send(distributionId, List<SendMessageResult> results = sender.send(distributionId,