Fix a bug in A_Star.Graph in jdk17 (#2842)

Co-authored-by: Andrii Siriak <siryaka@gmail.com>
This commit is contained in:
R_juzi 2021-11-24 16:29:38 +08:00 committed by GitHub
parent 6c00beec90
commit fb3cec06a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ public class A_Star {
public Graph(int size) { public Graph(int size) {
this.graph = new ArrayList<>(); this.graph = new ArrayList<>();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
this.graph.set(i, new ArrayList<>()); this.graph.add(new ArrayList<>());
} }
} }