mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
opt:replace vector push_back with emplace_back
This commit is contained in:
parent
c448f56f2b
commit
289beca884
|
@ -555,7 +555,7 @@ MdictParser::BlockInfoVector MdictParser::decodeHeadWordBlockInfo( QByteArray co
|
|||
qint64 compressedSize = readNumber( s );
|
||||
// headword block decompressed size
|
||||
qint64 decompressedSize = readNumber( s );
|
||||
headWordBlockInfos.push_back( BlockInfoVector::value_type( compressedSize, decompressedSize ) );
|
||||
headWordBlockInfos.emplace_back(compressedSize, decompressedSize);
|
||||
}
|
||||
|
||||
return headWordBlockInfos;
|
||||
|
@ -588,7 +588,7 @@ MdictParser::HeadWordIndex MdictParser::splitHeadWordBlock( QByteArray const & b
|
|||
}
|
||||
p += headWordBuf.size();
|
||||
QString headWord = toUtf16( encoding_, headWordBuf.constBegin(), headWordBuf.size() );
|
||||
index.push_back( HeadWordIndex::value_type( headWordId, headWord ) );
|
||||
index.emplace_back(headWordId, headWord);
|
||||
}
|
||||
|
||||
return index;
|
||||
|
|
4
mdx.cc
4
mdx.cc
|
@ -435,8 +435,8 @@ void MdxDictionary::doDeferredInit()
|
|||
idx.read( &buf.front(), sz );
|
||||
uint32_t btreeMaxElements = idx.read<uint32_t>();
|
||||
uint32_t rootOffset = idx.read<uint32_t>();
|
||||
mddFileNames.push_back( string( &buf.front() ) );
|
||||
mddIndexInfos.push_back( IndexInfo( btreeMaxElements, rootOffset ) );
|
||||
mddFileNames.emplace_back(&buf.front());
|
||||
mddIndexInfos.emplace_back(btreeMaxElements, rootOffset);
|
||||
}
|
||||
|
||||
vector< string > const dictFiles = getDictionaryFilenames();
|
||||
|
|
Loading…
Reference in a new issue