From beb620116b423f1b84b4131b8e56fa2b7a814209 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 10 Apr 2016 16:05:59 -0400 Subject: [PATCH] Database: Removed unused member --- src/Database.cpp | 10 ++++------ src/Database.h | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Database.cpp b/src/Database.cpp index 5dde5869..9ce4c1ff 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -37,7 +37,7 @@ void Database::initialize (const std::string& location) { _location = location; - _current = currentDataFile (); + auto current = currentDataFile (); // Because the data files have names YYYY-MM.data, sorting them by name also // sorts by the intervals within. @@ -47,8 +47,8 @@ void Database::initialize (const std::string& location) // Ensure the list always contains the name of the current file, even if it // does not exist. - if (std::find (files.begin (), files.end (), _current) == files.end ()) - files.push_back (_current); + if (std::find (files.begin (), files.end (), current) == files.end ()) + files.push_back (current); for (auto& file : files) { @@ -146,9 +146,7 @@ std::string Database::dump () const std::stringstream out; out << "Database\n"; for (auto& file : _files) - out << " Datafile: " << file.name () - << (file.name () == _current ? " (current)" : "") - << "\n"; + out << " Datafile: " << file.name () << "\n"; out << " Dirty: " << (_dirty ? "true" : "false") << "\n"; diff --git a/src/Database.h b/src/Database.h index 5c986056..6e6bae21 100644 --- a/src/Database.h +++ b/src/Database.h @@ -56,7 +56,6 @@ private: private: std::string _location {"~/.timewarrior/data"}; - std::string _current {}; std::vector _files {}; bool _dirty {false}; std::vector _exclusions {};