From c9f1d6744fa58796382d369579f891107d59bd67 Mon Sep 17 00:00:00 2001 From: Paul Keith Date: Sun, 17 Feb 2019 05:20:04 +0100 Subject: sdk: Cleanup usage of List.toArray(T[] a) * The parameter here only has to have the type you want it to return, so creating an array of size > 0 is unnecessary and wasteful Change-Id: I28e490fb6fa3703d7edca21b29d640105072947b --- host/migration/src/AdbCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/migration/src/AdbCommand.java') diff --git a/host/migration/src/AdbCommand.java b/host/migration/src/AdbCommand.java index 54cdb7b7..bdc54640 100644 --- a/host/migration/src/AdbCommand.java +++ b/host/migration/src/AdbCommand.java @@ -54,7 +54,7 @@ public class AdbCommand extends Command { List commandList = new ArrayList( baseCommand.length + 1); commandList.addAll(Arrays.asList(baseCommand)); - String[] commands = commandList.toArray(new String[commandList.size()]); + String[] commands = commandList.toArray(new String[0]); if (MigrationTest.DEBUG) { System.out.println("Using commands: " + Arrays.toString(commands)); -- cgit v1.2.3