Fix CppCheck ftfilecreator.cc

/libretroshare/src/ft/ftfilecreator.cc:86: warning:
Cppcheck(unusedVariable): Unused variable: it
/libretroshare/src/ft/ftfilecreator.cc:545: warning:
Cppcheck(unreadVariable): Variable 'chunks_for_this_peer' is modified
but its new value is never used.
This commit is contained in:
Phenom 2017-07-21 13:13:48 +02:00 committed by csoler
parent 68934499d4
commit 51ed0324f6

View File

@ -83,7 +83,7 @@ bool ftFileCreator::getFileData(const RsPeerId& peer_id,uint64_t offset, uint32_
// try if we have data from an incomplete or not veryfied chunk
if(!have_it && allow_unverified)
{
std::map<uint64_t, ftChunk>::iterator it;
//std::map<uint64_t, ftChunk>::iterator it;
have_it = true;
// this map contains chunks which are currently being downloaded
for(std::map<uint64_t,ftChunk>::iterator it=mChunks.begin(); it!=mChunks.end(); ++it)
@ -542,6 +542,7 @@ bool ftFileCreator::getMissingChunk(const RsPeerId& peer_id,uint32_t size_hint,u
mChunks[chunk.offset] = chunk ;
offset = chunk.offset ;
// cppcheck-suppress unreadVariable
size = chunk.size ;
++chunks_for_this_peer ; // increase number of chunks for this peer.