From 8a92cbf34ad90a9dc7e45461d792b2c3c03098c6 Mon Sep 17 00:00:00 2001 From: xiaoyifang <105986+xiaoyifang@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:25:29 +0800 Subject: [PATCH] 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> --- src/instances.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/instances.cc b/src/instances.cc index 8c817295..d175c6d3 100644 --- a/src/instances.cc +++ b/src/instances.cc @@ -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 ); }