mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
changed post fixed operator++ into prefixed. More efficient on some systems. Patch from Phenom.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7630 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
880efee332
commit
d547cb6fdb
82 changed files with 717 additions and 718 deletions
|
@ -1596,7 +1596,7 @@ int TcpStream::check_InPkts()
|
|||
}
|
||||
else
|
||||
{
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
|
|
|
@ -689,7 +689,7 @@ static int tou_passall()
|
|||
* check if idle are still idle.
|
||||
*/
|
||||
std::vector<TcpOnUdp *>::iterator it;
|
||||
for(it = tou_streams.begin(); it != tou_streams.end(); it++)
|
||||
for(it = tou_streams.begin(); it != tou_streams.end(); ++it)
|
||||
{
|
||||
if ((*it) && ((*it)->tcp))
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@ int UdpPeerReceiver::status(std::ostream &out)
|
|||
out << "UdpPeerReceiver::status()" << std::endl;
|
||||
out << "UdpPeerReceiver::peers:" << std::endl;
|
||||
std::map<struct sockaddr_in, UdpPeer *>::iterator it;
|
||||
for(it = streams.begin(); it != streams.end(); it++)
|
||||
for(it = streams.begin(); it != streams.end(); ++it)
|
||||
{
|
||||
out << "\t" << it->first << std::endl;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ int UdpPeerReceiver::removeUdpPeer(UdpPeer *peer)
|
|||
|
||||
/* check for duplicate */
|
||||
std::map<struct sockaddr_in, UdpPeer *>::iterator it;
|
||||
for(it = streams.begin(); it != streams.end(); it++)
|
||||
for(it = streams.begin(); it != streams.end(); ++it)
|
||||
{
|
||||
if (it->second == peer)
|
||||
{
|
||||
|
|
|
@ -139,7 +139,7 @@ int UdpRelayReceiver::removeUdpPeer(UdpPeer *peer)
|
|||
RsStackMutex stack(udppeerMtx); /********** LOCK MUTEX *********/
|
||||
|
||||
std::map<struct sockaddr_in, UdpPeer *>::iterator it;
|
||||
for(it = mPeers.begin(); it != mPeers.end(); it++)
|
||||
for(it = mPeers.begin(); it != mPeers.end(); ++it)
|
||||
{
|
||||
if (it->second == peer)
|
||||
{
|
||||
|
@ -190,7 +190,7 @@ int UdpRelayReceiver::getRelayEnds(std::list<UdpRelayEnd> &relayEnds)
|
|||
|
||||
std::map<struct sockaddr_in, UdpRelayEnd>::iterator rit;
|
||||
|
||||
for(rit = mStreams.begin(); rit != mStreams.end(); rit++)
|
||||
for(rit = mStreams.begin(); rit != mStreams.end(); ++rit)
|
||||
{
|
||||
relayEnds.push_back(rit->second);
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ int UdpRelayReceiver::getRelayProxies(std::list<UdpRelayProxy> &relayProxies)
|
|||
|
||||
std::map<UdpRelayAddrSet, UdpRelayProxy>::iterator rit;
|
||||
|
||||
for(rit = mRelays.begin(); rit != mRelays.end(); rit++)
|
||||
for(rit = mRelays.begin(); rit != mRelays.end(); ++rit)
|
||||
{
|
||||
relayProxies.push_back(rit->second);
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ int UdpRelayReceiver::checkRelays()
|
|||
|
||||
#define BANDWIDTH_FILTER_K (0.8)
|
||||
|
||||
for(rit = mRelays.begin(); rit != mRelays.end(); rit++)
|
||||
for(rit = mRelays.begin(); rit != mRelays.end(); ++rit)
|
||||
{
|
||||
/* calc bandwidth */
|
||||
//rit->second.mBandwidth = rit->second.mDataSize / (float) (now - rit->second.mLastBandwidthTS);
|
||||
|
@ -327,7 +327,7 @@ int UdpRelayReceiver::checkRelays()
|
|||
}
|
||||
|
||||
std::list<UdpRelayAddrSet>::iterator it;
|
||||
for(it = eraseList.begin(); it != eraseList.end(); it++)
|
||||
for(it = eraseList.begin(); it != eraseList.end(); ++it)
|
||||
{
|
||||
removeUdpRelay_relayLocked(&(*it));
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ int UdpRelayReceiver::RelayStatus(std::ostream &out)
|
|||
out << std::endl;
|
||||
|
||||
std::map<UdpRelayAddrSet, UdpRelayProxy>::iterator rit;
|
||||
for(rit = mRelays.begin(); rit != mRelays.end(); rit++)
|
||||
for(rit = mRelays.begin(); rit != mRelays.end(); ++rit)
|
||||
{
|
||||
out << "Relay for: " << rit->first;
|
||||
out << std::endl;
|
||||
|
@ -649,7 +649,7 @@ int UdpRelayReceiver::status(std::ostream &out)
|
|||
out << "UdpRelayReceiver::Connections:" << std::endl;
|
||||
|
||||
std::map<struct sockaddr_in, UdpRelayEnd>::iterator pit;
|
||||
for(pit = mStreams.begin(); pit != mStreams.end(); pit++)
|
||||
for(pit = mStreams.begin(); pit != mStreams.end(); ++pit)
|
||||
{
|
||||
out << "\t" << pit->first << " : " << pit->second;
|
||||
out << std::endl;
|
||||
|
@ -670,7 +670,7 @@ int UdpRelayReceiver::UdpPeersStatus(std::ostream &out)
|
|||
out << std::endl;
|
||||
|
||||
std::map<struct sockaddr_in, UdpPeer *>::iterator pit;
|
||||
for(pit = mPeers.begin(); pit != mPeers.end(); pit++)
|
||||
for(pit = mPeers.begin(); pit != mPeers.end(); ++pit)
|
||||
{
|
||||
out << "UdpPeer for: " << pit->first;
|
||||
out << " is: " << pit->second;
|
||||
|
|
|
@ -649,7 +649,7 @@ bool UdpStunner::storeStunPeer(const struct sockaddr_in &remote, const char *
|
|||
RsStackMutex stack(stunMtx); /********** LOCK MUTEX *********/
|
||||
|
||||
std::list<TouStunPeer>::iterator it;
|
||||
for(it = mStunList.begin(); it != mStunList.end(); it++)
|
||||
for(it = mStunList.begin(); it != mStunList.end(); ++it)
|
||||
{
|
||||
if ((remote.sin_addr.s_addr == it->remote.sin_addr.s_addr) &&
|
||||
(remote.sin_port == it->remote.sin_port))
|
||||
|
@ -719,7 +719,7 @@ bool UdpStunner::dropStunPeer(const struct sockaddr_in &remote)
|
|||
}
|
||||
else
|
||||
{
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -956,7 +956,7 @@ bool UdpStunner::locked_recvdStun(const struct sockaddr_in &remote, const str
|
|||
|
||||
bool found = true;
|
||||
std::list<TouStunPeer>::iterator it;
|
||||
for(it = mStunList.begin(); it != mStunList.end(); it++)
|
||||
for(it = mStunList.begin(); it != mStunList.end(); ++it)
|
||||
{
|
||||
if ((remote.sin_addr.s_addr == it->remote.sin_addr.s_addr) &&
|
||||
(remote.sin_port == it->remote.sin_port))
|
||||
|
@ -1038,7 +1038,7 @@ bool UdpStunner::locked_checkExternalAddress()
|
|||
std::list<TouStunPeer>::reverse_iterator it;
|
||||
std::list<TouStunPeer>::reverse_iterator p1;
|
||||
std::list<TouStunPeer>::reverse_iterator p2;
|
||||
for(it = mStunList.rbegin(); it != mStunList.rend(); it++)
|
||||
for(it = mStunList.rbegin(); it != mStunList.rend(); ++it)
|
||||
{
|
||||
/* check:
|
||||
1) have response.
|
||||
|
@ -1138,7 +1138,7 @@ bool UdpStunner::locked_printStunList()
|
|||
rs_sprintf_append(out, "\tLastRecvAny: %ld\n", now - mStunLastRecvAny);
|
||||
|
||||
std::list<TouStunPeer>::iterator it;
|
||||
for(it = mStunList.begin(); it != mStunList.end(); it++)
|
||||
for(it = mStunList.begin(); it != mStunList.end(); ++it)
|
||||
{
|
||||
out += "id:" + RsUtil::BinToHex(it->id);
|
||||
rs_sprintf_append(out, " addr: %s:%u", rs_inet_ntoa(it->remote.sin_addr).c_str(), htons(it->remote.sin_port));
|
||||
|
@ -1162,7 +1162,7 @@ bool UdpStunner::getStunPeer(int idx, std::string &id,
|
|||
|
||||
std::list<TouStunPeer>::iterator it;
|
||||
int i;
|
||||
for(i=0, it=mStunList.begin(); (i<idx) && (it!=mStunList.end()); it++, i++) ;
|
||||
for(i=0, it=mStunList.begin(); (i<idx) && (it!=mStunList.end()); ++it, i++) ;
|
||||
|
||||
if (it != mStunList.end())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue