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;
}
numbytes += filesize;
numblocks += blocks( filesize );
- begin++;
+ ++begin;
}
}