This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new 6911ead7c7 Refactor to replace LinkedList with ArrayDeque 6911ead7c7 is described below commit 6911ead7c7f6e8c7606639c2fd346402c83b7269 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Oct 6 11:38:53 2022 +0100 Refactor to replace LinkedList with ArrayDeque --- java/org/apache/catalina/ha/session/DeltaRequest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/java/org/apache/catalina/ha/session/DeltaRequest.java b/java/org/apache/catalina/ha/session/DeltaRequest.java index 1d1dd23e44..f5134f5fd5 100644 --- a/java/org/apache/catalina/ha/session/DeltaRequest.java +++ b/java/org/apache/catalina/ha/session/DeltaRequest.java @@ -29,7 +29,8 @@ import java.io.Externalizable; import java.io.IOException; import java.io.ObjectOutputStream; import java.security.Principal; -import java.util.LinkedList; +import java.util.ArrayDeque; +import java.util.Deque; import org.apache.catalina.SessionListener; import org.apache.catalina.realm.GenericPrincipal; @@ -65,8 +66,8 @@ public class DeltaRequest implements Externalizable { public static final String NAME_LISTENER = "__SET__LISTENER__"; private String sessionId; - private LinkedList<AttributeInfo> actions = new LinkedList<>(); - private final LinkedList<AttributeInfo> actionPool = new LinkedList<>(); + private Deque<AttributeInfo> actions = new ArrayDeque<>(); + private final Deque<AttributeInfo> actionPool = new ArrayDeque<>(); private boolean recordAllActions = false; @@ -291,7 +292,7 @@ public class DeltaRequest implements Externalizable { recordAllActions = in.readBoolean(); int cnt = in.readInt(); if (actions == null) { - actions = new LinkedList<>(); + actions = new ArrayDeque<>(); } else { actions.clear(); } @@ -322,8 +323,7 @@ public class DeltaRequest implements Externalizable { out.writeUTF(getSessionId()); out.writeBoolean(recordAllActions); out.writeInt(getSize()); - for ( int i=0; i<getSize(); i++ ) { - AttributeInfo info = actions.get(i); + for (AttributeInfo info : actions) { info.writeExternal(out); } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org