From 0038f2b0e5a51baef501d94ee91ea8e469298fd5 Mon Sep 17 00:00:00 2001 From: "Carl N. Baldwin" Date: Tue, 25 Oct 2005 21:20:18 -0600 Subject: [PATCH] No comment --- main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/main.cpp b/main.cpp index 2323efe..3a86a2b 100644 --- a/main.cpp +++ b/main.cpp @@ -154,29 +154,28 @@ int main() { // Now find the list of files to backup. file_set backups; - insert_iterator backups_i( backups, backups.begin() ); // backup all added files - copy( added.begin(), added.end(), backups_i ); + copy( added.begin(), added.end(), inserter( backups, backups.begin() ) ); // Track the total size of added files unsigned long long added_blocks, added_bytes; sizes( added.begin(), added.end(), added_blocks, added_bytes ); - file_vector modified_files; + file_vector modified_v; // Backup files that have been modified file_set::iterator i = common.begin(), j = old_common.begin(); for( ; i != common.end(); ++i, ++j ) { (*i)->setLastBackupDate( (*j)->getLastBackupDate() ); - if( needs_backup( *j, *i ) ) modified_files.push_back( *i ); + if( needs_backup( *j, *i ) ) modified_v.push_back( *i ); } - copy( modified_files.begin(), modified_files.end(), backups_i ); + copy( modified_v.begin(), modified_v.end(), inserter( backups, backups.begin() ) ); // Track the total size of modified files unsigned long long modified_blocks, modified_bytes; - sizes( modified_files.begin(), modified_files.end(), modified_blocks, modified_bytes ); + sizes( modified_v.begin(), modified_v.end(), modified_blocks, modified_bytes ); // Now, sort the backups by filesize and build a list that'll fit on a DVD file_vector backups_s; @@ -186,7 +185,7 @@ int main() { sort( backups_s.begin(), backups_s.end(), sizecmp ); file_set final; - unsigned long long space = 0x100000000ULL; // After looking at how big the ISO can be and how many 1K blocks are left after formatting the filesystem I decided on an even 4GB target + unsigned long long space = 0x100000000ULL; insert_iterator final_i( final, final.begin() ); -- 2.34.1