- Timestamp:
- Jan 10, 2016, 1:54:11 PM (8 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/libraries/network/PeerList.cc
r10622 r11054 41 41 PeerList::addPeer( ENetPeer *toadd ) 42 42 { /* error correction */ 43 if( toadd == NULL)43 if( toadd == nullptr ) 44 44 { orxout(internal_error, context::master_server) << "PeerList::addPeer: empty peer given." << endl; 45 45 return -1; … … 65 65 bool 66 66 PeerList::remPeerByAddr( ENetAddress addr ) 67 { /* get an iterator */ 68 std::list<ENetPeer *>::iterator i; 69 67 { 70 68 /* loop through list elements */ 71 for( i = peerlist.begin(); i != peerlist.end(); ++i)72 if( !sub_compAddr( (*i)->address, addr ) )69 for( ENetPeer* peer : peerlist ) 70 if( !sub_compAddr(peer->address, addr ) ) 73 71 { /* found this name, remove and quit */ 74 this->peerlist.remove( *i);72 this->peerlist.remove( peer ); 75 73 return true; 76 74 } … … 82 80 ENetPeer * 83 81 PeerList::findPeerByAddr( ENetAddress addr ) 84 { /* get an iterator */ 85 std::list<ENetPeer *>::iterator i; 86 82 { 87 83 /* loop through list elements */ 88 for( i = peerlist.begin(); i != peerlist.end(); ++i)89 if( !sub_compAddr( (*i)->address, addr ) )84 for( ENetPeer* peer : peerlist ) 85 if( !sub_compAddr(peer->address, addr ) ) 90 86 /* found this name, remove and quit */ 91 return *i;87 return peer; 92 88 93 89 /* not found */ 94 return NULL;90 return nullptr; 95 91 } 96 92
Note: See TracChangeset
for help on using the changeset viewer.