X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=blobdiff_plain;ds=inline;f=main.cpp;h=2323efe3295da8031ab88a111b590f38a8a6787d;hb=ce454c7d92e63a941a1277406e466005d74eb148;hp=a5518501772afaa7d180a0f07c2ff3b077991efe;hpb=9f95453a2b3a4ffde7c553b93a6cac6eec618958;p=backups%2F.git diff --git a/main.cpp b/main.cpp index a551850..2323efe 100644 --- a/main.cpp +++ b/main.cpp @@ -29,20 +29,19 @@ template bool copy_until_full( I begin, I end, O out, INT &space ) { bool complete = true; - I i = begin; - while( 0 != space && i != end ) { - INT size = (*i)->getFileSize(); + while( 0 != space && begin != end ) { + INT size = (*begin)->getFileSize(); INT blocksize = blocks( size ) * bytes_in_block; if( blocksize <= space ) { space -= blocksize; - out = *i; + out = *begin; ++out; } else { // We missed a file that should be included so the backup is not complete complete = false; } - ++i; + ++begin; } return complete; } @@ -104,7 +103,7 @@ void sizes( ITER begin, const ITER &end, INT &numblocks, INT &numbytes ) { numbytes += filesize; numblocks += blocks( filesize ); - begin++; + ++begin; } }