Prevent duplicate characters in "Also choose from" field of password generator (#9803)

* Fixes #9797
This commit is contained in:
f4lkensmaz3 2024-01-06 21:54:30 +00:00 committed by GitHub
parent 07232f04c0
commit ce01f6d7cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,8 +261,10 @@ QVector<PasswordGroup> PasswordGenerator::passwordGroups() const
if (!m_custom.isEmpty()) {
PasswordGroup group;
for (auto ch : m_custom) {
group.append(ch);
for (const auto& ch : m_custom) {
if (!group.contains(ch)) {
group.append(ch);
}
}
passwordGroups.append(group);