From 6916b03899f9980b536c5735c8069a15eff4e5ce Mon Sep 17 00:00:00 2001 From: David Hebbeker Date: Sat, 2 Jan 2021 15:51:26 +0100 Subject: Optimize: usedDir can not be parent of dd if they have the same parent. --- src/dotdirdeps.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dotdirdeps.cpp b/src/dotdirdeps.cpp index f049527..db5be2a 100644 --- a/src/dotdirdeps.cpp +++ b/src/dotdirdeps.cpp @@ -81,7 +81,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations) // draw all directories which have `dd->parent()` as parent and `dd` as dependent const auto newEnd = std::remove_if(usedDirsNotDrawn.begin(), usedDirsNotDrawn.end(), [&](const DirDef *const usedDir) { - if (dd!=usedDir && dd->parent()==usedDir->parent() && !usedDir->isParentOf(dd)) + if (dd!=usedDir && dd->parent()==usedDir->parent()) { drawDirectory(t, usedDir, usedDir->isCluster() && !Config_getBool(DOT_TRANSPARENT), dirsInGraph); return true; @@ -136,8 +136,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations) // shortName().data(), // !usedDir->isParentOf(this) // ); - if (dir!=usedDir && dir->parent()==usedDir->parent() && - !usedDir->isParentOf(dd)) + if (dir!=usedDir && dir->parent()==usedDir->parent()) // include if both have the same parent (or no parent) { drawDirectory(t, usedDir, usedDir->isCluster() && !Config_getBool(DOT_TRANSPARENT), dirsInGraph); -- cgit v0.12