mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 21:37:39 +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
@ -845,11 +845,12 @@ public final class SimplePluginManager implements PluginManager {
|
||||
Preconditions.checkArgument(depend != null, "depend");
|
||||
|
||||
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;
|
||||
}
|
||||
for (String provided : depend.getProvides()) {
|
||||
if (Graphs.reachableNodes(dependencyGraph, plugin.getName()).contains(provided)) {
|
||||
if (reachableNodes.contains(provided)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user