1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Added is_empty() method to transaction class

Method is_empty() can be determined if there have no been changes
to the transaction.
This commit is contained in:
Teemu Ollakka
2018-10-26 11:47:44 +03:00
parent 5391de0474
commit d4efa598bb
4 changed files with 12 additions and 1 deletions

View File

@ -51,6 +51,7 @@ namespace wsrep
const branch_type& root() const { return root_; }
void clear() { root_.clear(); }
bool empty() const { return root_.empty(); }
private:
branch_type root_;
};

View File

@ -98,6 +98,14 @@ namespace wsrep
return (streaming_context_.fragments_certified() > 0);
}
/**
* Return true if transaction has not generated any changes.
*/
bool is_empty() const
{
return sr_keys_.empty();
}
bool pa_unsafe() const { return pa_unsafe_; }
void pa_unsafe(bool pa_unsafe) { pa_unsafe_ = pa_unsafe; }