contacts/contacts-cache: cleanups

refactor code a bit; move sorting to Contact

remove unneeded hashing in Contact (just use the email address)
This commit is contained in:
Dirk-Jan C. Binnema
2025-05-25 11:20:52 +03:00
parent 9f08397fdd
commit 668d5ffb99
4 changed files with 105 additions and 132 deletions

View File

@ -61,16 +61,6 @@ Mu::to_string(const Mu::Contacts& contacts)
return res;
}
size_t
Mu::lowercase_hash(const std::string& s)
{
std::size_t djb = 5381; // djb hash
for (const auto c : s)
djb = ((djb << 5) + djb) +
static_cast<size_t>(g_ascii_tolower(c));
return djb;
}
#ifdef BUILD_TESTS
/*
* Tests.