Repository: xbmc/xbmc
File: xbmc/filesystem/DiscDirectoryHelper.h (C/C++)

Code before:
    std::chrono::milliseconds duration{0ms};
    std::chrono::milliseconds durationDelta{0ms};
    int multiple{0};
    unsigned int chapters{0};
    std::vector<unsigned int> clips;
    std::string languages;

    // Used for inserting into a set where playlist is the key
    bool operator<(const CandidatePlaylistInformation& rhs) const noexcept
    {
      return playlist < rhs.playlist;
    }
  };

  // For removing duplicates from a vector of CandidatePlaylistInformation
  struct CandidatePlaylistInformationNotDuplicate
  {
    explicit CandidatePlaylistInformationNotDuplicate(std::set<int64_t>& seen) : seen_(seen) {}

    bool operator()(const CandidatePlaylistInformation& c) const noexcept
    {
      return seen_.insert(c.duration.count()).second;
    }

  private:
    std::set<int64_t>& seen_;
  };

public:
  CDiscDirectoryHelper();
  CDiscDirectoryHelper(const CDiscDirectoryHelper&) = delete;
  CDiscDirectoryHelper& operator=(const CDiscDirectoryHelper&) = delete;

  /*!
   * \brief Populates a CFileItemList with the playlist(s) corresponding to the given episode.
   * \param url bluray:// episode url
   * \param items CFileItemList to populate
   * \param episodeIndex index into episodesOnDisc
   * \param episodesOnDisc vector array of CVideoInfoTags - one for each episode on the disc (populated by GetEpisodesOnDisc)
   * \param clips map of clips on disc (populated in CBlurayDirectory)
   * \param playlists map of playlists on disc (populated in CBlurayDirectory)
   * \return true if at least one playlist is found, otherwise false
   */
  bool GetEpisodePlaylists(const CURL& url,
                           CFileItemList& items,
                           int episodeIndex,
                           const std::vector<CVideoInfoTag>& episodesOnDisc,
                           const ClipMap& clips,
                           const PlaylistMap& playlists);

  /*!

Review comment (suggestion):
```suggestion
    std::set<int64_t>& m_seen;
```

Code after:
    std::chrono::milliseconds duration{0ms};
    std::chrono::milliseconds durationDelta{0ms};
    int multiple{0};
    unsigned int chapters{0};
    std::vector<unsigned int> clips;
    std::string languages;

    // Used for inserting into a set where playlist is the key
    bool operator<(const CandidatePlaylistInformation& rhs) const noexcept
    {
      return playlist < rhs.playlist;
    }
  };

  // For removing duplicates from a vector of CandidatePlaylistInformation
  struct CandidatePlaylistInformationNotDuplicate
  {
    explicit CandidatePlaylistInformationNotDuplicate(std::set<int64_t>& seen) : m_seen(seen) {}

    bool operator()(const CandidatePlaylistInformation& c) const noexcept
    {
      return m_seen.insert(c.duration.count()).second;
    }

  private:
    std::set<int64_t>& m_seen;
  };

public:
  CDiscDirectoryHelper();
  CDiscDirectoryHelper(const CDiscDirectoryHelper&) = delete;
  CDiscDirectoryHelper& operator=(const CDiscDirectoryHelper&) = delete;

  /*!
   * \brief Populates a CFileItemList with the playlist(s) corresponding to the given episode.
   * \param url bluray:// episode url
   * \param items CFileItemList to populate
   * \param episodeIndex index into episodesOnDisc
   * \param episodesOnDisc vector array of CVideoInfoTags - one for each episode on the disc (populated by GetEpisodesOnDisc)
   * \param clips map of clips on disc (populated in CBlurayDirectory)
   * \param playlists map of playlists on disc (populated in CBlurayDirectory)
   * \return true if at least one playlist is found, otherwise false
   */
  bool GetEpisodePlaylists(const CURL& url,
                           CFileItemList& items,
                           int episodeIndex,
                           const std::vector<CVideoInfoTag>& episodesOnDisc,
                           const ClipMap& clips,
                           const PlaylistMap& playlists);

  /*!