diff --git a/redisson/src/main/java/org/redisson/command/CommandBatchService.java b/redisson/src/main/java/org/redisson/command/CommandBatchService.java index b375180ac..ee4e4091a 100644 --- a/redisson/src/main/java/org/redisson/command/CommandBatchService.java +++ b/redisson/src/main/java/org/redisson/command/CommandBatchService.java @@ -287,7 +287,7 @@ public class CommandBatchService extends CommandAsyncService { if (RedisCommands.EXEC.getName().equals(details.getCommand().getName())) { Entry entry = commands.get(details.getSource().getEntry()); - List> list = new LinkedList>(); + List> list = new ArrayList<>(); if (options.isSkipResult()) { list.add(new CommandData(new RedissonPromise(), details.getCodec(), RedisCommands.CLIENT_REPLY, new Object[]{ "OFF" })); @@ -310,7 +310,7 @@ public class CommandBatchService extends CommandAsyncService { details.setWriteFuture(future); } else { RPromise main = new RedissonPromise(); - List> list = new LinkedList>(); + List> list = new ArrayList<>(); list.add(new CommandData(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); ChannelFuture future = connection.send(new CommandsData(main, list, true)); details.setWriteFuture(future); @@ -847,7 +847,7 @@ public class CommandBatchService extends CommandAsyncService { boolean isAtomic = executionMode != ExecutionMode.IN_MEMORY; boolean isQueued = executionMode == ExecutionMode.REDIS_READ_ATOMIC || executionMode == ExecutionMode.REDIS_WRITE_ATOMIC; - List> list = new LinkedList>(); + List> list = new ArrayList<>(entry.getCommands().size()); if (source.getRedirect() == Redirect.ASK) { RPromise promise = new RedissonPromise(); list.add(new CommandData(promise, StringCodec.INSTANCE, RedisCommands.ASKING, new Object[] {}));