Permalink
Browse files

Pre-increment iterators for efficiency in serverpool and mythraopconn…

…ection.
  • Loading branch information...
1 parent 740a5ba commit 9be52e263903898e0b368d676f0609ef5dfb899f @stuartm stuartm committed May 7, 2012
Showing with 5 additions and 5 deletions.
  1. +3 −3 mythtv/libs/libmythbase/serverpool.cpp
  2. +2 −2 mythtv/libs/libmythtv/mythraopconnection.cpp
@@ -393,7 +393,7 @@ bool ServerPool::bind(QList<QHostAddress> addrs, quint16 port,
if (it->protocol() == QAbstractSocket::IPv6Protocol)
{
QList<QNetworkAddressEntry>::iterator iae;
- for (iae = naList_6.begin(); iae != naList_6.end(); iae++)
+ for (iae = naList_6.begin(); iae != naList_6.end(); ++iae)
{
if (PrivUdpSocket::contains(*iae, *it))
{
@@ -406,7 +406,7 @@ bool ServerPool::bind(QList<QHostAddress> addrs, quint16 port,
#endif
{
QList<QNetworkAddressEntry>::iterator iae;
- for (iae = naList_4.begin(); iae != naList_4.end(); iae++)
+ for (iae = naList_4.begin(); iae != naList_4.end(); ++iae)
{
if (PrivUdpSocket::contains(*iae, *it))
{
@@ -481,7 +481,7 @@ qint64 ServerPool::writeDatagram(const char * data, qint64 size,
{
// find the right socket to use
QList<PrivUdpSocket*>::iterator it;
- for (it = m_udpSockets.begin(); it != m_udpSockets.end(); it++)
+ for (it = m_udpSockets.begin(); it != m_udpSockets.end(); ++it)
{
PrivUdpSocket *val = *it;
if (val->contains(addr))
@@ -660,7 +660,7 @@ void MythRAOPConnection::ProcessAudio()
m_lastSequence++;
QList<AudioData>::iterator it = frames.data->begin();
- for (; it != frames.data->end(); it++)
+ for (; it != frames.data->end(); ++it)
{
m_audio->AddData((char *)it->data, it->length,
timestamp, it->frames);
@@ -694,7 +694,7 @@ int MythRAOPConnection::ExpireAudio(uint64_t timestamp)
if (frames.data)
{
QList<AudioData>::iterator it = frames.data->begin();
- for (; it != frames.data->end(); it++)
+ for (; it != frames.data->end(); ++it)
{
av_free(it->data);
}

0 comments on commit 9be52e2

Please sign in to comment.