Fix CppCheck in p3turtle.cc

/libretroshare/src/turtle/p3turtle.cc:1450: warning:
Cppcheck(unusedVariable): Unused variable: info
/libretroshare/src/turtle/p3turtle.cc:1875: warning:
Cppcheck(redundantIfRemove): Redundant checking of STL container element
existence before removing it.
This commit is contained in:
Phenom 2017-07-30 14:29:22 +02:00 committed by csoler
parent 2728880621
commit 2933861691

View File

@ -1447,7 +1447,7 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item)
// We're off-mutex here. // We're off-mutex here.
bool found = false ; bool found = false ;
std::string info ; //std::string info ;
RsTurtleClientService *service = NULL ; RsTurtleClientService *service = NULL ;
if(item->PeerId() != _own_id) if(item->PeerId() != _own_id)
@ -1872,13 +1872,12 @@ void p3turtle::monitorTunnels(const RsFileHash& hash,RsTurtleClientService *clie
// First, check if the hash is tagged for removal (there's a delay) // First, check if the hash is tagged for removal (there's a delay)
if(_hashes_to_remove.find(hash) != _hashes_to_remove.end()) if(_hashes_to_remove.erase(hash) > 0)
{ {
_hashes_to_remove.erase(hash) ;
#ifdef P3TURTLE_DEBUG #ifdef P3TURTLE_DEBUG
std::cerr << "p3turtle: File hash " << hash << " Was scheduled for removal. Canceling the removal." << std::endl ; std::cerr << "p3turtle: File hash " << hash << " Was scheduled for removal. Canceling the removal." << std::endl ;
#endif #endif
} }
// Then, check if the hash is already there // Then, check if the hash is already there
// //