Short circuit Driver.firstFinishedFuture with one future
@@ -650,6 +650,10 @@ public class Driver
private static ListenableFuture<?> firstFinishedFuture(List<ListenableFuture<?>> futures)
{
+ if (futures.size() == 1) {
+ return futures.get(0);
+ }
+
SettableFuture<?> result = SettableFuture.create();
for (ListenableFuture<?> future : futures) {
