mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 03:22:19 +01:00
#615: Calculate the reachable nodes only once per transitive dependency check.
By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
parent
c6409a81fd
commit
24bab712b3
1 changed files with 3 additions and 2 deletions
|
@ -845,11 +845,12 @@ public final class SimplePluginManager implements PluginManager {
|
||||||
Preconditions.checkArgument(depend != null, "depend");
|
Preconditions.checkArgument(depend != null, "depend");
|
||||||
|
|
||||||
if (dependencyGraph.nodes().contains(plugin.getName())) {
|
if (dependencyGraph.nodes().contains(plugin.getName())) {
|
||||||
if (Graphs.reachableNodes(dependencyGraph, plugin.getName()).contains(depend.getName())) {
|
Set<String> reachableNodes = Graphs.reachableNodes(dependencyGraph, plugin.getName());
|
||||||
|
if (reachableNodes.contains(depend.getName())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
for (String provided : depend.getProvides()) {
|
for (String provided : depend.getProvides()) {
|
||||||
if (Graphs.reachableNodes(dependencyGraph, plugin.getName()).contains(provided)) {
|
if (reachableNodes.contains(provided)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue