src/x11/extensions/randr.cpp
/**
   * Searches for a monitor with name in monitors
   *
   * Does best-fit matching (if exact_match == true, this is also first-fit)
   */
Searches for a monitor with name in monitors
Does best-fit matching (if exact_match == true, this is also first-fit)
Searches for a monitor with name in monitors Does best - fit matching ( if exact_match == true this is also first - fit )
monitor_t match_monitor(vector<monitor_t> monitors, const string& name, bool exact_match) {
    monitor_t result{};
    for (auto&& monitor : monitors) {
      if (monitor->match(name, true)) {
        result = move(monitor);
        break;
      }
      if (!exact_match && monitor->match(name, false)) {
        result = move(monitor);
      }
    }
    return result;
  }
monitor_t match_monitor ( vector < monitor_t > monitors , const string & name , bool exact_match ) { monitor_t result { } ; for ( auto && monitor : monitors ) { if ( monitor -> match ( name , true ) ) { result = move ( monitor ) ; break ; } if ( ! exact_match && monitor -> match ( name , false ) ) { result = move ( monitor ) ; } } return result ; }
Searches for a monitor with name in monitors
 Does best-fit matching (if exact_match == true, this is also first-fit)
Searches for a monitor with name in monitors Does best - fit matching ( if exact_match == true this is also first - fit )
// If we can do an exact match, we have found our result /*
       * Non-exact matches are moved into the result but we continue searching
       * through the list, maybe we can find an exact match
       * Note: If exact_match == true, we don't need to run this because it
       * would be the exact same check as above
       */