From d99856370937b4984072944419af05e9cdd71e68 Mon Sep 17 00:00:00 2001 From: Xiao Yi Fang Date: Wed, 17 Jul 2024 14:43:37 +0800 Subject: [PATCH] opt: before invoke,the parameters have already called reserved() --- src/btreeidx.cc | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/btreeidx.cc b/src/btreeidx.cc index 856ca3af..efad109d 100644 --- a/src/btreeidx.cc +++ b/src/btreeidx.cc @@ -1097,27 +1097,6 @@ void BtreeIndex::findArticleLinks( QVector< WordArticleLink > * articleLinks, for ( ;; ) { 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 ) { if ( isCancelled && Utils::AtomicInt::loadAcquire( *isCancelled ) ) return;