use erase directly for cleanupConnection

This commit is contained in:
Stephen Birarda 2015-09-17 14:51:48 -07:00
parent a914ec82c3
commit 285a6cc738

View file

@ -207,14 +207,12 @@ void Socket::clearConnections() {
}
void Socket::cleanupConnection(HifiSockAddr sockAddr) {
auto it = _connectionsHash.find(sockAddr);
auto numErased = _connectionsHash.erase(sockAddr);
if (it != _connectionsHash.end()) {
if (numErased > 0) {
#ifdef UDT_CONNECTION_DEBUG
qCDebug(networking) << "Socket::cleanupConnection called for UDT connection to" << sockAddr;
#endif
_connectionsHash.erase(sockAddr);
}
}