Skip to content

Commit 2e66bec

Browse files
gsmetgunnarmorling
authored andcommitted
HV-1480 We expect at least one node in the path so let's initialize the
list with one element It doesn't seem necessary to consider more elements as the list will be copied when new nodes will be added.
1 parent f39e179 commit 2e66bec

File tree

1 file changed

+1
-1
lines changed
  • engine/src/main/java/org/hibernate/validator/internal/engine/path

1 file changed

+1
-1
lines changed

engine/src/main/java/org/hibernate/validator/internal/engine/path/PathImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ private PathImpl(PathImpl path) {
358358
}
359359

360360
private PathImpl() {
361-
nodeList = new ArrayList<>();
361+
nodeList = new ArrayList<>( 1 );
362362
hashCode = -1;
363363
nodeListRequiresCopy = false;
364364
}

0 commit comments

Comments
 (0)