Skip to content

Commit 0a05b04

Browse files
committed
Extract method to create subnetwork encoded values
1 parent 119b093 commit 0a05b04

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/main/java/com/graphhopper/GraphHopper.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,8 @@ protected EncodingManager buildEncodingManager(Map<String, PMap> encodedValuesWi
604604
})
605605
.filter(Objects::nonNull)
606606
.toList());
607-
profilesByName.values().forEach(profile -> encodedValues.add(Subnetwork.create(profile.getName())));
607+
608+
encodedValues.addAll(createSubnetworkEncodedValues());
608609

609610
List<String> sortedEVs = getEVSortIndex(profilesByName);
610611
encodedValues.sort(Comparator.comparingInt(ev -> sortedEVs.indexOf(ev.getName())));
@@ -617,6 +618,10 @@ protected EncodingManager buildEncodingManager(Map<String, PMap> encodedValuesWi
617618
return emBuilder.build();
618619
}
619620

621+
protected List<BooleanEncodedValue> createSubnetworkEncodedValues() {
622+
return profilesByName.values().stream().map(profile -> Subnetwork.create(profile.getName())).toList();
623+
}
624+
620625
protected List<String> getEVSortIndex(Map<String, Profile> profilesByName) {
621626
return Collections.emptyList();
622627
}

0 commit comments

Comments
 (0)