summaryrefslogtreecommitdiffstats
path: root/src/dirdef.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2016-01-24 14:03:15 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2016-01-31 15:29:54 (GMT)
commit5475bf2e9a0f1517567186b47595b8dad2b6b3a3 (patch)
tree75524eac9133c0a2165df52f43b198abe1b046c2 /src/dirdef.cpp
parent67827956351f78516a7c48df366dcf521c51c6eb (diff)
downloadDoxygen-5475bf2e9a0f1517567186b47595b8dad2b6b3a3.zip
Doxygen-5475bf2e9a0f1517567186b47595b8dad2b6b3a3.tar.gz
Doxygen-5475bf2e9a0f1517567186b47595b8dad2b6b3a3.tar.bz2
Improved sorting performance for directories and files
Diffstat (limited to 'src/dirdef.cpp')
-rw-r--r--src/dirdef.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index 307d3be..d458777 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -67,17 +67,23 @@ bool DirDef::isLinkable() const
void DirDef::addSubDir(DirDef *subdir)
{
- m_subdirs.inSort(subdir);
+ m_subdirs.append(subdir);
subdir->setOuterScope(this);
subdir->m_parent=this;
}
void DirDef::addFile(FileDef *fd)
{
- m_fileList->inSort(fd);
+ m_fileList->append(fd);
fd->setDirDef(this);
}
+void DirDef::sort()
+{
+ m_subdirs.sort();
+ m_fileList->sort();
+}
+
static QCString encodeDirName(const QCString &anchor)
{
// convert to md5 hash
@@ -593,11 +599,20 @@ void DirDef::computeDependencies()
//printf(" %d: add dependency %s->%s\n",count++,name().data(),usedDir->name().data());
addUsesDependency(usedDir,fd,ii->fileDef,FALSE);
}
- }
+ }
}
}
}
}
+ if (m_usedDirs)
+ {
+ QDictIterator<UsedDir> udi(*m_usedDirs);
+ UsedDir *udir;
+ for (udi.toFirst();(udir=udi.current());++udi)
+ {
+ udir->sort();
+ }
+ }
}
bool DirDef::isParentOf(DirDef *dir) const
@@ -640,10 +655,15 @@ UsedDir::~UsedDir()
void UsedDir::addFileDep(FileDef *srcFd,FileDef *dstFd)
{
- m_filePairs.inSort(srcFd->getOutputFileBase()+dstFd->getOutputFileBase(),
+ m_filePairs.append(srcFd->getOutputFileBase()+dstFd->getOutputFileBase(),
new FilePair(srcFd,dstFd));
}
+void UsedDir::sort()
+{
+ m_filePairs.sort();
+}
+
FilePair *UsedDir::findFilePair(const char *name)
{
QCString n=name;
@@ -659,7 +679,7 @@ DirDef *DirDef::createNewDir(const char *path)
//printf("Adding new dir %s\n",path);
dir = new DirDef(path);
//printf("createNewDir %s short=%s\n",path,dir->shortName().data());
- Doxygen::directories->inSort(path,dir);
+ Doxygen::directories->append(path,dir);
}
return dir;
}
@@ -919,6 +939,11 @@ void buildDirectories()
}
}
}
+ for (sdi.toFirst();(dir=sdi.current());++sdi)
+ {
+ dir->sort();
+ }
+ Doxygen::directories->sort();
computeCommonDirPrefix();
}