Skip to content

Commit

Permalink
performance: Prefer prefix ++/-- operators for non-primitive types.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Feb 16, 2022
1 parent 1969c11 commit 9ecc10e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mainwindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3566,7 +3566,7 @@ void MainWindow::on_saveArticle_triggered()

// Pull and save resources to files
for ( vector< pair< QUrl, QString > >::const_iterator i = downloadResources.begin();
i != downloadResources.end(); i++ )
i != downloadResources.end(); ++i )
{
ResourceToSaveHandler * handler = view->saveResource( i->first, i->second );
if( !handler->isEmpty() )
Expand Down
2 changes: 1 addition & 1 deletion mdictparser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ bool MdictParser::readNextHeadWordIndex( MdictParser::HeadWordIndex & headWordIn
return false;

headWordIndex = splitHeadWordBlock( decompressed );
headWordBlockInfosIter_++;
++headWordBlockInfosIter_;
return true;
}

Expand Down
12 changes: 6 additions & 6 deletions mdx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ void MddResourceRequest::run()
catch ( File::exCantOpen & )
{
for ( vector< sptr< IndexedMdd > >::const_iterator i = dict.mddResources.begin();
i != dict.mddResources.end(); i++ )
i != dict.mddResources.end(); ++i )
{
sptr< IndexedMdd > mddResource = *i;
if ( mddResource->loadFile( resourceName, data ) )
Expand Down Expand Up @@ -1272,7 +1272,7 @@ QString MdxDictionary::getCachedFileName( QString filename )
catch ( File::exCantOpen & )
{
for ( vector< sptr< IndexedMdd > >::const_iterator i = mddResources.begin();
i != mddResources.end(); i++ )
i != mddResources.end(); ++i )
{
sptr< IndexedMdd > mddResource = *i;
if ( mddResource->loadFile( resourceName, data ) )
Expand Down Expand Up @@ -1447,7 +1447,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
{
vector< sptr< Dictionary::Class > > dictionaries;

for ( vector< string >::const_iterator i = fileNames.begin(); i != fileNames.end(); i++ )
for ( vector< string >::const_iterator i = fileNames.begin(); i != fileNames.end(); ++i )
{
// Skip files with the extensions different to .mdx to speed up the
// scanning
Expand Down Expand Up @@ -1477,7 +1477,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
initializing.indexingDictionary( title );

for ( vector< string >::const_iterator mddIter = dictFiles.begin() + 1;
mddIter != dictFiles.end(); mddIter++ )
mddIter != dictFiles.end(); ++mddIter )
{
if ( File::exists( *mddIter ) )
{
Expand Down Expand Up @@ -1576,7 +1576,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
idxHeader.styleSheetCount = styleSheets.size();

for ( MdictParser::StyleSheets::const_iterator iter = styleSheets.begin();
iter != styleSheets.end(); iter++ )
iter != styleSheets.end(); ++iter )
{
string styleBegin( iter->second.first.toUtf8().constData() );
string styleEnd( iter->second.second.toUtf8().constData() );
Expand Down Expand Up @@ -1607,7 +1607,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
// Build index info for each mdd file
vector< IndexInfo > mddIndexInfos;
for ( vector< sptr< IndexedWords > >::const_iterator mddIndexIter = mddIndices.begin();
mddIndexIter != mddIndices.end(); mddIndexIter++ )
mddIndexIter != mddIndices.end(); ++mddIndexIter )
{
IndexInfo resourceIdxInfo = BtreeIndexing::buildIndex( *( *mddIndexIter ), idx );
mddIndexInfos.push_back( resourceIdxInfo );
Expand Down
2 changes: 1 addition & 1 deletion processwrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ unsigned int ProcessWrapper::findProcess(const char *name, unsigned int pid_skip
QDir pd("/proc");
QFileInfoList list = pd.entryInfoList(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot);
QFileInfoList::iterator it, it_end = list.end();
for (it = list.begin(); it != it_end; it++)
for (it = list.begin(); it != it_end; ++it)
{
const QFileInfo &fi = *it;
if (fi.baseName().at(0).isDigit()) {
Expand Down

0 comments on commit 9ecc10e

Please sign in to comment.