Commit d09760fd authored by Milian Wolff's avatar Milian Wolff
Browse files

f

parent 47c0dc10
......@@ -727,3 +727,22 @@ void MakeFileResolver::setOutOfSourceBuildSystem(const QString& source, const QS
m_source = QDir::cleanPath(source);
m_build = QDir::cleanPath(m_build);
}
Path MakeFileResolver::internPath(const QString& path) const
{
Path& ret = m_pathCache[path];
if (ret.isEmpty() != path.isEmpty()) {
ret = Path(path);
}
return ret;
}
QString MakeFileResolver::internString(const QString& path) const
{
auto it = m_stringCache.constFind(path);
if (it != m_stringCache.constEnd()) {
return *it;
}
m_stringCache.insert(path);
return path;
}
\ No newline at end of file
......@@ -84,6 +84,13 @@ class MakeFileResolver
const QString& makeParameters, const SourcePathInformation& source, int maxDepth );
QString m_source;
QString m_build;
// reuse cached instances of Paths and strings, to share memory where possible
mutable QHash<QString, KDevelop::Path> m_pathCache;
mutable QSet<QString> m_stringCache;
KDevelop::Path internPath(const QString& path) const;
QString internString(const QString& string) const;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment