mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Datafile: sort lines in ascending order before writes
This commit is contained in:
parent
44e5dd7b84
commit
c0086ec150
1 changed files with 3 additions and 0 deletions
|
@ -135,6 +135,9 @@ void Datafile::commit ()
|
|||
_file.truncate ();
|
||||
_file.append (std::string ("")); // Seek to EOF.
|
||||
|
||||
// Sort the intervals by ascending start time.
|
||||
std::sort (_lines.begin (), _lines.end ());
|
||||
|
||||
// Write out all the lines.
|
||||
for (auto& line : _lines)
|
||||
_file.write_raw (line + '\n');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue