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

Define undefined id and gtid as const static member variables.

Use default seqno and id constructors in default gtid ctor
instead of calls to static undefined to initialize.
This commit is contained in:
Teemu Ollakka
2019-01-18 23:57:24 +02:00
parent 55f6c63328
commit aeb5990642
4 changed files with 11 additions and 8 deletions

View File

@ -31,8 +31,8 @@ namespace wsrep
{
public:
gtid()
: id_(wsrep::id::undefined())
, seqno_(wsrep::seqno::undefined())
: id_()
, seqno_()
{ }
gtid(const wsrep::id& id, wsrep::seqno seqno)
: id_(id)
@ -44,13 +44,12 @@ namespace wsrep
{
return (seqno_.is_undefined() && id_.is_undefined());
}
static wsrep::gtid undefined()
static const wsrep::gtid& undefined()
{
static const wsrep::gtid ret(wsrep::id::undefined(),
wsrep::seqno::undefined());
return ret;
return undefined_;
}
private:
static const wsrep::gtid undefined_;
wsrep::id id_;
wsrep::seqno seqno_;
};