From 940909fac13af675cc0b6e22d0c85af251efca66 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Thu, 26 Dec 2024 18:01:09 +0800 Subject: [PATCH] 1 --- src/dict/stardict.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/dict/stardict.cc b/src/dict/stardict.cc index 758754ceb..741a36992 100644 --- a/src/dict/stardict.cc +++ b/src/dict/stardict.cc @@ -1658,25 +1658,17 @@ static void findCorrespondingFiles( string const & ifo, string & idx, string & d { string base( ifo, 0, ifo.size() - 3 ); - vector< string > idxFiles = - { base + "idx", base + "idx.gz", base + "idx.dz", base + "IDX", base + "IDX.GZ", base + "IDX.DZ" }; - - auto ret = Utils::Fs::anyExistingFile( idxFiles ); + auto ret = Utils::Fs::anyExistingFile( { base + "idx", base + "idx.gz", base + "idx.dz", base + "IDX", base + "IDX.GZ", base + "IDX.DZ" } ); if ( !ret ) { throw exNoIdxFile( ifo ); } - vector< string > dictFiles = { base + "dict", base + "dict.dz", base + "DICT", base + "dict.DZ" }; - - ret = Utils::Fs::anyExistingFile( dictFiles ); + ret = Utils::Fs::anyExistingFile( { base + "dict", base + "dict.dz", base + "DICT", base + "dict.DZ" } ); if ( !ret ) { throw exNoDictFile( ifo ); } - vector< string > synFiles = - { base + "syn", base + "syn.gz", base + "syn.dz", base + "SYN", base + "SYN.GZ", base + "SYN.DZ" }; - - ret = Utils::Fs::anyExistingFile( synFiles ); + ret = Utils::Fs::anyExistingFile( { base + "syn", base + "syn.gz", base + "syn.dz", base + "SYN", base + "SYN.GZ", base + "SYN.DZ" } ); if ( !ret ) { syn.clear();