Changeset 21560

Show
Ignore:
Timestamp:
21.01.2010 14:50:48 (9 years ago)
Author:
mdewsnip
Message:

Efficiency improvement to last changes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/inexport.pm

    r21559 r21560  
    298298    my $arcinfo_doc_filename = &doc_db_file($archivedir); 
    299299    my $arcinfo_src_filename = &src_db_file($archivedir); 
     300    my $doc_infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $arcinfo_doc_filename, "append"); 
     301    my $src_infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $arcinfo_src_filename, "append"); 
    300302 
    301303 
     
    311313 
    312314    # delete the src record 
    313     my $src_infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $arcinfo_src_filename, "append"); 
    314315    &dbutil::delete_infodb_entry("gdbm", $src_infodb_file_handle, $file); 
    315     &dbutil::close_infodb_write_handle("gdbm", $src_infodb_file_handle); 
    316316     
    317317    foreach my $oid (@$oids) { 
     
    343343 
    344344        my $val_rec = &dbutil::convert_infodb_string_to_hash($val); 
    345         my $doc_infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $arcinfo_doc_filename, "append"); 
    346345        &dbutil::write_infodb_entry("gdbm", $doc_infodb_file_handle, $oid, $val_rec); 
    347         &dbutil::close_infodb_write_handle("gdbm", $doc_infodb_file_handle); 
    348         } 
    349     } 
    350     } 
     346        } 
     347    } 
     348    } 
     349 
     350    &dbutil::close_infodb_write_handle("gdbm", $doc_infodb_file_handle); 
     351    &dbutil::close_infodb_write_handle("gdbm", $src_infodb_file_handle); 
    351352} 
    352353