opt: use seperate slob dictionary object to create the fulltext

🎨 apply clang-format changes
This commit is contained in:
YiFang Xiao 2023-07-12 21:11:49 +08:00
parent 40c890b5ca
commit 0dc0c015c7

View file

@ -584,6 +584,8 @@ class SlobDictionary: public BtreeIndexing::BtreeDictionary
SlobFile sf;
QString texCgiPath, texCachePath;
string idxFileName;
public:
SlobDictionary( string const & id, string const & indexFile, vector< string > const & dictionaryFiles );
@ -662,10 +664,9 @@ private:
friend class SlobResourceRequest;
};
SlobDictionary::SlobDictionary( string const & id,
string const & indexFile,
vector< string > const & dictionaryFiles ):
SlobDictionary::SlobDictionary( string const & id, string const & indexFile, vector< string > const & dictionaryFiles ):
BtreeDictionary( id, dictionaryFiles ),
idxFileName( indexFile ),
idx( indexFile, "rb" ),
idxHeader( idx.read< IdxHeader >() )
{
@ -1111,7 +1112,8 @@ void SlobDictionary::makeFTSIndex( QAtomicInt & isCancelled, bool firstIteration
try
{
FtsHelpers::makeFTSIndex( this, isCancelled );
const auto slob_dic = std::make_unique< SlobDictionary >( getId(), idxFileName, getDictionaryFilenames() );
FtsHelpers::makeFTSIndex( slob_dic.get(), isCancelled );
FTS_index_completed.ref();
}
catch( std::exception &ex )