From 25d78984f7acc8908c5895bbe23d2bd7bfbbdb51 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 30 Aug 2019 14:03:06 +0800 Subject: mon: use get_req<> instead of static_cast<>(get_req()) less repeating, better readability Signed-off-by: Kefu Chai --- src/mon/HealthMonitor.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mon/HealthMonitor.cc') diff --git a/src/mon/HealthMonitor.cc b/src/mon/HealthMonitor.cc index c6029b415d3..ca038a05565 100644 --- a/src/mon/HealthMonitor.cc +++ b/src/mon/HealthMonitor.cc @@ -167,7 +167,7 @@ version_t HealthMonitor::get_trim_to() const bool HealthMonitor::preprocess_query(MonOpRequestRef op) { - PaxosServiceMessage *m = static_cast(op->get_req()); + auto m = op->get_req(); switch (m->get_type()) { case MSG_MON_COMMAND: return preprocess_command(op); @@ -197,7 +197,7 @@ bool HealthMonitor::prepare_update(MonOpRequestRef op) bool HealthMonitor::preprocess_command(MonOpRequestRef op) { - MMonCommand *m = static_cast(op->get_req()); + auto m = op->get_req(); std::stringstream ss; bufferlist rdata; @@ -229,7 +229,7 @@ bool HealthMonitor::preprocess_command(MonOpRequestRef op) bool HealthMonitor::prepare_command(MonOpRequestRef op) { - MMonCommand *m = static_cast(op->get_req()); + auto m = op->get_req(); std::stringstream ss; bufferlist rdata; @@ -330,7 +330,7 @@ out: bool HealthMonitor::prepare_health_checks(MonOpRequestRef op) { - MMonHealthChecks *m = static_cast(op->get_req()); + auto m = op->get_req(); // no need to check if it's changed, the peon has done so quorum_checks[m->get_source().num()] = std::move(m->health_checks); return true; -- cgit v1.2.3