diff --git a/src/core/PasswordHealth.cpp b/src/core/PasswordHealth.cpp index 58e4e42af..c179db77c 100644 --- a/src/core/PasswordHealth.cpp +++ b/src/core/PasswordHealth.cpp @@ -116,17 +116,13 @@ HealthChecker::HealthChecker(QSharedPointer db) * Returns the health of the password in `entry`, considering * password entropy, re-use, expiration, etc. */ -QSharedPointer HealthChecker::evaluate(const Entry* entry) +QSharedPointer HealthChecker::evaluate(const Entry* entry) const { + // Pointer sanity check if (!entry) { return {}; } - // Return from cache if we saw it before - if (m_cache.contains(entry->uuid())) { - return m_cache[entry->uuid()]; - } - // First analyse the password itself const auto pwd = entry->password(); auto health = QSharedPointer(new PasswordHealth(pwd)); @@ -184,5 +180,5 @@ QSharedPointer HealthChecker::evaluate(const Entry* entry) } // Return the result - return m_cache.insert(entry->uuid(), health).value(); + return health; } diff --git a/src/core/PasswordHealth.h b/src/core/PasswordHealth.h index ca7f0236e..70f83eee7 100644 --- a/src/core/PasswordHealth.h +++ b/src/core/PasswordHealth.h @@ -101,12 +101,10 @@ public: explicit HealthChecker(QSharedPointer); // Get the health status of an entry in the database - QSharedPointer evaluate(const Entry* entry); + QSharedPointer evaluate(const Entry* entry) const; private: - // Result cache (first=entry UUID) - QHash> m_cache; - // first = password, second = entries that use it + // To determine password re-use: first = password, second = entries that use it QHash m_reuse; };