mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
opt: before invoke,the parameters have already called reserved()
This commit is contained in:
parent
521c359b24
commit
d998563709
|
@ -1097,27 +1097,6 @@ void BtreeIndex::findArticleLinks( QVector< WordArticleLink > * articleLinks,
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
vector< WordArticleLink > result = readChain( chainPtr );
|
vector< WordArticleLink > result = readChain( chainPtr );
|
||||||
|
|
||||||
if ( headwords
|
|
||||||
&& static_cast< vector< WordArticleLink >::size_type >( headwords->capacity() )
|
|
||||||
< headwords->size() + result.size() ) {
|
|
||||||
int n = headwords->capacity();
|
|
||||||
headwords->reserve( n + n / 10 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( offsets
|
|
||||||
&& static_cast< vector< WordArticleLink >::size_type >( offsets->capacity() )
|
|
||||||
< offsets->size() + result.size() ) {
|
|
||||||
int n = offsets->capacity();
|
|
||||||
offsets->reserve( n + n / 10 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( articleLinks
|
|
||||||
&& static_cast< vector< WordArticleLink >::size_type >( articleLinks->capacity() )
|
|
||||||
< articleLinks->size() + result.size() ) {
|
|
||||||
int n = articleLinks->capacity();
|
|
||||||
articleLinks->reserve( n + n / 10 );
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( auto & i : result ) {
|
for ( auto & i : result ) {
|
||||||
if ( isCancelled && Utils::AtomicInt::loadAcquire( *isCancelled ) )
|
if ( isCancelled && Utils::AtomicInt::loadAcquire( *isCancelled ) )
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue