I'm not very familiar with this code, so I may be missing something?
It seems excessive to have both inclusion in a map and a bool to represent the "plugged" state. And there are at most three elements!
Surely either a set (membership in the set implying the "plugged" state) or a three element array would be adequate.
E.g.
bool is_plugged_map[3] = { false, false, false };
...
if (!is_plugged_map[display_name]) return {};
(It would be nice to eliminate the "magic number" 3 by adding a DisplayName::max_names)
« Back to merge proposal
I'm not very familiar with this code, so I may be missing something?
It seems excessive to have both inclusion in a map and a bool to represent the "plugged" state. And there are at most three elements!
Surely either a set (membership in the set implying the "plugged" state) or a three element array would be adequate.
E.g.
bool is_plugged_map[3] = { false, false, false };
...
if (!is_plugged_ map[display_ name]) return {};
(It would be nice to eliminate the "magic number" 3 by adding a DisplayName: :max_names)