Use const qualifier since warnings vector won't be modified by the
helper methods and use also use a reference instead of a regular
variable.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit
5ee832185b19cee270dc462dca4d73328cc13c2b)
}
}
-bool MDSMonitor::has_health_warnings(vector<mds_metric_t> warnings, const mds_gid_t& gid)
+bool MDSMonitor::has_health_warnings(const vector<mds_metric_t>& warnings, const mds_gid_t& gid)
{
for (auto& [_gid, health] : pending_daemon_health) {
if (gid != MDS_GID_NONE) {
bool preprocess_query(MonOpRequestRef op) override; // true if processed.
bool prepare_update(MonOpRequestRef op) override;
bool should_propose(double& delay) override;
- bool has_health_warnings(std::vector<mds_metric_t> warnings,
+ bool has_health_warnings(const std::vector<mds_metric_t>& warnings,
const mds_gid_t& gid=MDS_GID_NONE);
bool has_health_warnings(const std::vector<mds_metric_t>& warnings,
const std::vector<mds_gid_t>& gids);