Mir

Code review comment for lp:~phablet-team/mir/track-plug-state

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

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)

review: Needs Information

« Back to merge proposal