VcsInfo: Remove unneeded c'tor and operator==

Change-Id: I6b2a797290854bd34abc6680d5377749678ef687
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-10-04 14:50:32 +02:00
parent cd582faa7e
commit 3d70de9382

View File

@@ -44,16 +44,6 @@ class VcsManagerPrivate
public: public:
class VcsInfo { class VcsInfo {
public: public:
VcsInfo() = default;
VcsInfo(IVersionControl *vc, const QString &tl) :
versionControl(vc), topLevel(tl)
{ }
bool operator == (const VcsInfo &other) const
{
return versionControl == other.versionControl && topLevel == other.topLevel;
}
IVersionControl *versionControl = nullptr; IVersionControl *versionControl = nullptr;
QString topLevel; QString topLevel;
}; };
@@ -99,7 +89,7 @@ public:
QString tmpDir = dir; QString tmpDir = dir;
const QChar slash = QLatin1Char('/'); const QChar slash = QLatin1Char('/');
while (tmpDir.count() >= topLevel.count() && !tmpDir.isEmpty()) { while (tmpDir.count() >= topLevel.count() && !tmpDir.isEmpty()) {
m_cachedMatches.insert(tmpDir, VcsInfo(vc, topLevel)); m_cachedMatches.insert(tmpDir, {vc, topLevel});
// if no vc was found, this might mean we're inside a repo internal directory (.git) // if no vc was found, this might mean we're inside a repo internal directory (.git)
// Cache only input directory, not parents // Cache only input directory, not parents
if (!vc) if (!vc)