From 71972a5265dc9b383bbbaf6ae9d8f86ab407c1a1 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 17 Feb 2019 18:48:40 -0800 Subject: [PATCH] Use pre-increment operator with iterators --- src/common/glcmn.cpp | 2 +- src/common/textfile.cpp | 4 ++-- src/common/xpmdecod.cpp | 2 +- src/osx/fswatcher_fsevents.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/glcmn.cpp b/src/common/glcmn.cpp index 03dd583ca1..5512f93407 100644 --- a/src/common/glcmn.cpp +++ b/src/common/glcmn.cpp @@ -45,7 +45,7 @@ void wxGLAttribsBase::AddAttribBits(int searchVal, int combineVal) // Search for searchVal wxVector::iterator it = m_GLValues.begin(); while ( it != m_GLValues.end() && *it != searchVal ) - it++; + ++it; // Have we searchVal? if ( it != m_GLValues.end() ) { diff --git a/src/common/textfile.cpp b/src/common/textfile.cpp index 7dc3421d4a..fe7628d6d5 100644 --- a/src/common/textfile.cpp +++ b/src/common/textfile.cpp @@ -105,7 +105,7 @@ bool wxTextFile::OnRead(const wxMBConv& conv) // the beginning of the current line, changes inside the loop wxString::const_iterator lineStart = str.begin(); const wxString::const_iterator end = str.end(); - for ( wxString::const_iterator p = lineStart; p != end; p++ ) + for ( wxString::const_iterator p = lineStart; p != end; ++p ) { const wxChar ch = *p; if ( ch == '\r' || ch == '\n' ) @@ -129,7 +129,7 @@ bool wxTextFile::OnRead(const wxMBConv& conv) // DOS EOL is the only one consisting of two chars, not one. if ( lineType == wxTextFileType_Dos ) - p++; + ++p; lineStart = p + 1; } diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp index 4449f2a699..7c7df92bad 100644 --- a/src/common/xpmdecod.cpp +++ b/src/common/xpmdecod.cpp @@ -812,7 +812,7 @@ wxImage wxXPMDecoder::ReadData(const char* const* xpm_data) unsigned char* g = new unsigned char[colors_cnt]; unsigned char* b = new unsigned char[colors_cnt]; - for (it = clr_tbl.begin(), i = 0; it != clr_tbl.end(); it++, i++) + for (it = clr_tbl.begin(), i = 0; it != clr_tbl.end(); ++it, ++i) { r[i] = it->second.R; g[i] = it->second.G; diff --git a/src/osx/fswatcher_fsevents.cpp b/src/osx/fswatcher_fsevents.cpp index b90f96febf..06f41a7ba0 100644 --- a/src/osx/fswatcher_fsevents.cpp +++ b/src/osx/fswatcher_fsevents.cpp @@ -419,7 +419,7 @@ bool wxFsEventsFileSystemWatcher::RemoveAll() FSEventStreamStop(it->second); FSEventStreamInvalidate(it->second); FSEventStreamRelease(it->second); - it++; + ++it; ret |= true; } m_streams.clear(); @@ -499,7 +499,7 @@ int wxFsEventsFileSystemWatcher::GetWatchedPaths(wxArrayString* paths) const } wxFileSystemWatcherBase::GetWatchedPaths(paths); FSEventStreamRefMap::const_iterator it = m_streams.begin(); - for ( ; it != m_streams.end(); it++ ) + for ( ; it != m_streams.end(); ++it ) { paths->push_back(it->first); }