Skip to content

Commit

Permalink
Improve code structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Iam-WenYi committed Sep 14, 2024
1 parent df66a16 commit 04e8add
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/command/cmd_admin.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CmdConfig : public BaseCmdGroup {
private:
// std::vector<std::string> subCmd_;

void DoCmd(PClient* client) override{};
void DoCmd(PClient* client) override {};
};

class CmdConfigGet : public BaseCmd {
Expand Down Expand Up @@ -178,7 +178,7 @@ class CmdDebug : public BaseCmdGroup {
bool DoInitial(PClient* client) override { return true; };

private:
void DoCmd(PClient* client) override{};
void DoCmd(PClient* client) override {};
};

class CmdDebugHelp : public BaseCmd {
Expand Down
5 changes: 2 additions & 3 deletions src/kiwi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ bool KiwiDB::ParseArgs(int argc, char* argv[]) {

switch (c) {
case 'v': {
std::cerr << "kiwi Server version: " << Kiwi_VERSION << " bits=" << (sizeof(void*) == 8 ? 64 : 32)
<< std::endl;
std::cerr << "kiwi Server version: " << Kiwi_VERSION << " bits=" << (sizeof(void*) == 8 ? 64 : 32) << std::endl;
std::cerr << "kiwi Server Build Type: " << Kiwi_BUILD_TYPE << std::endl;
#if defined(Kiwi_BUILD_DATE)
std::cerr << "kiwi Server Build Date: " << Kiwi_BUILD_DATE << std::endl;
Expand Down Expand Up @@ -201,7 +200,7 @@ bool KiwiDB::Init() {
PREPL.SetMasterAddr(g_config.master_ip.ToString().c_str(), g_config.master_port.load());
}

event_server_ =std::make_unique<net::EventServer<std::shared_ptr<PClient>>>(num);
event_server_ = std::make_unique<net::EventServer<std::shared_ptr<PClient>>>(num);

event_server_->SetRwSeparation(true);

Expand Down
4 changes: 1 addition & 3 deletions src/kiwi.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ class KiwiDB final {
event_server_->SendPacket(client, std::move(msg));
}

inline void CloseConnection(const std::shared_ptr<kiwi::PClient>& client) {
event_server_->CloseConnection(client);
}
inline void CloseConnection(const std::shared_ptr<kiwi::PClient>& client) { event_server_->CloseConnection(client); }

void TCPConnect(
const net::SocketAddr& addr,
Expand Down

0 comments on commit 04e8add

Please sign in to comment.