Skip to content

Commit

Permalink
Canonical variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
lqxhub committed Nov 14, 2023
1 parent 3b07dbe commit 9707357
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class PClient : public std::enable_shared_from_this<PClient>, public CmdRes {
int processInlineCmd(const char*, size_t, std::vector<std::string>&);
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<TcpConnection> tcp_connection_;
Expand Down

0 comments on commit 9707357

Please sign in to comment.