mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Database: firstLine -> getLatestEntry
firstLine is ambiguous (the first line that was added in time? The first line that will be returned when iterating the database?) See https://github.com/GothenburgBitFactory/timewarrior/pull/269#discussion_r367922757
This commit is contained in:
parent
c7c1ea632a
commit
1abf6e9320
3 changed files with 5 additions and 5 deletions
|
@ -268,7 +268,7 @@ std::set <std::string> Database::tags () const
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Return most recent line from database
|
||||
std::string Database::firstLine ()
|
||||
std::string Database::getLatestEntry ()
|
||||
{
|
||||
for (auto& line : *this)
|
||||
{
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
std::vector <std::string> files () const;
|
||||
std::set <std::string> tags () const;
|
||||
|
||||
std::string firstLine ();
|
||||
std::string getLatestEntry ();
|
||||
|
||||
void addInterval (const Interval&, bool verbose);
|
||||
void deleteInterval (const Interval&);
|
||||
|
|
|
@ -784,10 +784,10 @@ std::vector <Range> getUntracked (
|
|||
Interval getLatestInterval (Database& database)
|
||||
{
|
||||
Interval i;
|
||||
auto firstLine = database.firstLine ();
|
||||
if (! firstLine.empty ())
|
||||
auto latestEntry = database.getLatestEntry ();
|
||||
if (! latestEntry.empty ())
|
||||
{
|
||||
i = IntervalFactory::fromSerialization (firstLine);
|
||||
i = IntervalFactory::fromSerialization (latestEntry);
|
||||
}
|
||||
|
||||
return i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue