summaryrefslogtreecommitdiffhomepage
path: root/ui/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-19 17:52:51 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-19 17:52:51 -0600
commit90050a00081dbbc43bddd828cb7d3a8014edc404 (patch)
tree735feacb017d8a8d4714a9e0dc7b237d8443cc1e /ui/src
parent87c9efce4a65cee0f48bc944048609c7b385de79 (diff)
TunnelListFragment: cleanup list type
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt6
1 files changed, 2 insertions, 4 deletions
diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt
index cb3636fe..ff7b8bce 100644
--- a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt
+++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt
@@ -316,10 +316,8 @@ class TunnelListFragment : BaseFragment() {
Application.getTunnelManager().tunnels.thenAccept { tunnels ->
val tunnelsToDelete = ArrayList<ObservableTunnel>()
for (position in copyCheckedItems) tunnelsToDelete.add(tunnels[position])
- val futures = tunnelsToDelete
- .map { obj -> obj.delete() }
- .toTypedArray()
- CompletableFuture.allOf(*futures as Array<out CompletableFuture<*>>)
+ val futures = tunnelsToDelete.map { it.delete().toCompletableFuture() }.toTypedArray()
+ CompletableFuture.allOf(*futures)
.thenApply { futures.size }
.whenComplete(this@TunnelListFragment::onTunnelDeletionFinished)
}