Skip to content

Commit 03406e3

Browse files
committed
Apply review changes
1 parent a170385 commit 03406e3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

platforms/core-runtime/base-services/src/main/java/org/gradle/internal/graph/CachingDirectedGraphWalker.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ public class CachingDirectedGraphWalker<N, T> {
4040
private final DirectedGraphWithEdgeValues<N, T> graph;
4141
private List<N> startNodes = new ArrayList<N>();
4242
private Set<NodeDetails<N, T>> strongComponents = new LinkedHashSet<NodeDetails<N, T>>();
43+
44+
/**
45+
* We use an immutable set for cached node values since the cache can become quite large
46+
* for very large graphs, and immutable sets are much more memory efficient than LinkedHashSets.
47+
*/
4348
private final Map<N, ImmutableSet<T>> cachedNodeValues = new HashMap<N, ImmutableSet<T>>();
4449

4550
public CachingDirectedGraphWalker(DirectedGraph<N, T> graph) {
@@ -162,8 +167,6 @@ private Set<T> doSearch() {
162167
} else {
163168
// Not part of a strongly connected component or the root of a strongly connected component
164169
for (NodeDetails<N, T> componentMember : details.componentMembers) {
165-
// We use an immutable set for cached node values since the cache can become quite large
166-
// for very large graphs, and immutable sets are much more memory efficient than LinkedHashSets.
167170
cachedNodeValues.put(componentMember.node, ImmutableSet.copyOf(details.values));
168171
componentMember.finished = true;
169172
components.remove(componentMember.component);

platforms/native/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/msvcpp/ArchitectureDescriptorBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Map<String, String> getDefinitions() {
182182
ArchitectureSpecificVisualCpp buildDescriptor(VersionNumber compilerVersion, File basePath, File vsPath) {
183183
File commonTools = new File(vsPath, PATH_COMMONTOOLS);
184184
File commonIde = new File(vsPath, PATH_COMMONIDE);
185-
List<File> paths = new ArrayList<>();
185+
List<File> paths = new ArrayList<>(3);
186186
paths.add(commonTools);
187187
paths.add(commonIde);
188188
File crossCompilePath = getCrossCompilePath(basePath);

0 commit comments

Comments
 (0)