Skip to content

Commit 0e64e82

Browse files
committed
Micro-optimization to try to right size the array
1 parent a1ed020 commit 0e64e82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-session-jdbc/src/main/java/org/springframework/session/jdbc/JdbcIndexedSessionRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ private void save() {
907907
});
908908
}
909909
else {
910-
List<Runnable> deltaActions = new ArrayList<>();
910+
List<Runnable> deltaActions = JdbcSession.this.changed ? new ArrayList<>(4) : new ArrayList<>();
911911
if (JdbcSession.this.changed) {
912912
deltaActions.add(() -> {
913913
Map<String, String> indexes = JdbcIndexedSessionRepository.this.indexResolver

0 commit comments

Comments
 (0)