summaryrefslogtreecommitdiff
path: root/src/archive.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/archive.cc')
-rw-r--r--src/archive.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/archive.cc b/src/archive.cc
index 5ea6cd8e..d36712ca 100644
--- a/src/archive.cc
+++ b/src/archive.cc
@@ -201,23 +201,23 @@ bool archive_t::should_load(const std::list<path>& data_files)
return true;
}
-bool archive_t::should_save(shared_ptr<journal_t> journal)
+bool archive_t::should_save(journal_t& journal)
{
std::list<path> data_files;
DEBUG("archive.journal", "Should the archive be saved?");
- if (journal->was_loaded) {
+ if (journal.was_loaded) {
DEBUG("archive.journal", "No, it's one we loaded before");
return false;
}
- if (journal->sources.empty()) {
+ if (journal.sources.empty()) {
DEBUG("archive.journal", "No, there were no sources!");
return false;
}
- foreach (const journal_t::fileinfo_t& i, journal->sources) {
+ foreach (const journal_t::fileinfo_t& i, journal.sources) {
if (i.from_stream) {
DEBUG("archive.journal", "No, one source was from a stream");
return false;
@@ -241,14 +241,14 @@ bool archive_t::should_save(shared_ptr<journal_t> journal)
return true;
}
-void archive_t::save(shared_ptr<journal_t> journal)
+void archive_t::save(journal_t& journal)
{
INFO_START(archive, "Saved journal file cache");
ofstream stream(file, std::ios::binary);
write_header_bits(stream);
- sources = journal->sources;
+ sources = journal.sources;
#if defined(DEBUG_ON)
foreach (const journal_t::fileinfo_t& i, sources)
@@ -263,12 +263,12 @@ void archive_t::save(shared_ptr<journal_t> journal)
DEBUG("archive.journal",
"Archiving journal with " << sources.size() << " sources");
- oa << *journal;
+ oa << journal;
INFO_FINISH(archive);
}
-bool archive_t::load(shared_ptr<journal_t> journal)
+bool archive_t::load(journal_t& journal)
{
INFO_START(archive, "Read cached journal file");
@@ -282,8 +282,8 @@ bool archive_t::load(shared_ptr<journal_t> journal)
archive_t temp;
iarchive >> temp;
- iarchive >> *journal.get();
- journal->was_loaded = true;
+ iarchive >> journal;
+ journal.was_loaded = true;
INFO_FINISH(archive);