This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Description
Per feedback from @tomaszkapela on PR#46 , recommended C++11 updates that fall out of scope of PR#46 can be implemented as follows:
src/snap/config.cc:
74 std::string Config::get_string(const std::string& key) const {
75 auto str_map = rpc_map.stringmap();
76 return str_map.at(key);
77 }
--Oneline this method as well as all the others
src/snap/config.h:
24 /**
25 * A Rule of type std::string
26 */
27 typedef Rule<rpc::StringPolicy, rpc::StringRule, std::string> StringRule;
--Since C++11, it's preferred to write using StringRule = Rule<...
53 template<class P, class R, typename T>
54 class Rule final : public P {
55 private:
56 class rule final : public R {
--Consider new naming choice for Rule -> rule. Maybe internal_rule or rule_impl
90 Rule(const std::string& key, bool req) {
91 rule rl(req);
92 auto rule_ptr = this->mutable_rules();
93 (*rule_ptr)[key] = rl;
--(*rule_ptr)[key] = rule(req); to avoid triggering a move assignment
Please consider providing additional refactor requests in comments
Reactions are currently unavailable
Per feedback from @tomaszkapela on PR#46, recommended C++11 updates that fall out of scope of PR#46 can be implemented as follows:
src/snap/config.cc:
--Oneline this method as well as all the others
src/snap/config.h:
--Since C++11, it's preferred to write
using StringRule = Rule<...--Consider new naming choice for
Rule -> rule. Maybeinternal_ruleorrule_impl--
(*rule_ptr)[key] = rule(req);to avoid triggering a move assignmentPlease consider providing additional refactor requests in comments