fix: duplicate dictionary in config file (#1886)

* fix: duplicate dictionary in config file

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
xiaoyifang 2024-11-01 10:25:29 +08:00 committed by GitHub
parent 19bcd94834
commit 8a92cbf34a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,7 +31,8 @@ Group::Group( Config::Group const & cfgGroup,
for ( auto const & dict : cfgGroup.dictionaries ) {
std::string const dictId = dict.id.toStdString();
if ( dictMap.contains( dictId ) ) {
//avoid duplicate dictionary in groups in config file.
if ( dictMap.contains( dictId ) && !dictOrderList.contains( dictId ) ) {
groupDicts.insert( dictId, dictMap[ dictId ] );
dictOrderList.push_back( dictId );
}