From 97073576292a5305340e53b90f318091fd28402d Mon Sep 17 00:00:00 2001 From: lqx Date: Tue, 14 Nov 2023 21:52:29 +0800 Subject: [PATCH] Canonical variable name --- src/client.cc | 7 +++---- src/client.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/client.cc b/src/client.cc index 4e1e0b80f..a07154951 100644 --- a/src/client.cc +++ b/src/client.cc @@ -76,7 +76,6 @@ void CmdRes::SetRes(CmdRes::CmdRet _ret, const std::string& content) { case kInvalidFloat: SetLineString("-ERR value is not a valid float"); break; - break; case kOverFlow: SetLineString("-ERR increment or decrement would overflow"); break; @@ -520,7 +519,7 @@ bool PClient::isPeerMaster() const { return repl_addr.GetIP() == PeerIP() && repl_addr.GetPort() == PeerPort(); } -int PClient::uniqueId() const { +int PClient::uniqueID() const { if (auto c = getTcpConnection(); c) { return c->GetUniqueId(); } @@ -535,12 +534,12 @@ bool PClient::Watch(int dbno, const std::string& key) { bool PClient::NotifyDirty(int dbno, const std::string& key) { if (IsFlagOn(ClientFlagDirty)) { - INFO("client is already dirty {}", uniqueId()); + INFO("client is already dirty {}", uniqueID()); return true; } if (watch_keys_[dbno].contains(key)) { - INFO("{} client become dirty because key {} in db {}", uniqueId(), key, dbno); + INFO("{} client become dirty because key {} in db {}", uniqueID(), key, dbno); SetFlag(ClientFlagDirty); return true; } else { diff --git a/src/client.h b/src/client.h index e4f1c7672..708f4bb5a 100644 --- a/src/client.h +++ b/src/client.h @@ -188,7 +188,7 @@ class PClient : public std::enable_shared_from_this, public CmdRes { int processInlineCmd(const char*, size_t, std::vector&); void reset(); bool isPeerMaster() const; - int uniqueId() const; + int uniqueID() const; // TcpConnection's life is undetermined, so use weak ptr for safety. std::weak_ptr tcp_connection_;