Use pre-increment operator with iterators

This commit is contained in:
Paul Cornett
2019-02-17 18:48:40 -08:00
parent 360342659b
commit 71972a5265
4 changed files with 6 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ void wxGLAttribsBase::AddAttribBits(int searchVal, int combineVal)
// Search for searchVal
wxVector<int>::iterator it = m_GLValues.begin();
while ( it != m_GLValues.end() && *it != searchVal )
it++;
++it;
// Have we searchVal?
if ( it != m_GLValues.end() )
{

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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);
}