+ return device_name == std::string{"krillin"} || device_name == std::string{"mx4"};
I know there's existing code in this style, but it seem unnecessary to construct temporary string objects for these constants. As std::string has an operator==(std::string const&, const CharT*) the same test can be written more efficiently:
return device_name == "krillin" || device_name == "mx4";
« Back to merge proposal
+ return device_name == std::string{ "krillin" } || device_name == std::string{"mx4"};
I know there's existing code in this style, but it seem unnecessary to construct temporary string objects for these constants. As std::string has an operator= =(std:: string const&, const CharT*) the same test can be written more efficiently:
return device_name == "krillin" || device_name == "mx4";