fix: duplicate dictionary in config file

This commit is contained in:
xiaoyifang 2024-11-01 09:12:52 +08:00
parent 19bcd94834
commit 89c3eaeff8

View file

@ -31,7 +31,8 @@ Group::Group( Config::Group const & cfgGroup,
for ( auto const & dict : cfgGroup.dictionaries ) { for ( auto const & dict : cfgGroup.dictionaries ) {
std::string const dictId = dict.id.toStdString(); 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 ] ); groupDicts.insert( dictId, dictMap[ dictId ] );
dictOrderList.push_back( dictId ); dictOrderList.push_back( dictId );
} }