From 0882a08d188558c7f3ab493dad901cc8bb154654 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sun, 30 Apr 2023 21:46:01 +0000 Subject: [PATCH] Remove unnecessary TDB2::{modify,add} argument --- src/TDB2.cpp | 9 ++++----- src/TDB2.h | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 4348da01c..cf0da46c0 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -60,12 +60,11 @@ void TDB2::open_replica (const std::string& location, bool create_if_missing) //////////////////////////////////////////////////////////////////////////////// // Add the new task to the replica. -void TDB2::add (Task& task, bool/* = true */) +void TDB2::add (Task& task) { // Ensure the task is consistent, and provide defaults if necessary. - // bool argument to validate() is "applyDefault". Pass add_to_backlog through - // in order to not apply defaults to synchronized tasks. - // This also ensures that the `uuid` attribute is set. + // bool argument to validate() is "applyDefault", to apply default values for + // properties not otherwise given. task.validate (true); std::string uuid = task.get ("uuid"); @@ -123,7 +122,7 @@ void TDB2::add (Task& task, bool/* = true */) // This exhibits a bit of a race condition: if the stored task has changed since // it was loaded, this will revert those changes. In practice, this is not an // issue. -void TDB2::modify (Task& task, bool/* = true */) +void TDB2::modify (Task& task) { task.validate (false); auto uuid = task.get ("uuid"); diff --git a/src/TDB2.h b/src/TDB2.h index 6f448af3e..3d1eeadbf 100644 --- a/src/TDB2.h +++ b/src/TDB2.h @@ -47,8 +47,8 @@ public: TDB2 (); void open_replica (const std::string&, bool create_if_missing); - void add (Task&, bool add_to_backlog = true); - void modify (Task&, bool add_to_backlog = true); + void add (Task&); + void modify (Task&); void commit (); void get_changes (std::vector &); void revert ();