Change group map to an unordered_map

This commit is contained in:
Crash Cringle
2025-03-03 23:25:32 -08:00
committed by teejusb
parent 830bf1bb8d
commit 218d5734a3
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -349,7 +349,7 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName, Group* group )
// Add the group to its series if the group has one and if the series exists
if( group->GetSeries() != "" )
{
std::unordered_set<Group*>& series = m_mapSeriesToGroup[group->GetSeries()];
std::unordered_set<Group*>& series = m_mapSeriesToGroups[group->GetSeries()];
series.insert(group);
}
//m_sSongGroupBackgroundPaths.push_back( sBackgroundPath );
+4 -4
View File
@@ -147,8 +147,8 @@ public:
void GetPreferredSortSongs( std::vector<Song*> &AddTo ) const;
std::map<RString, std::vector<Song*>> GetPreferredSortSongsMap() const { return m_mapPreferredSectionToSongs;};
RString SongToPreferredSortSectionName( const Song *pSong ) const;
std::map<RString, Group*> GetGroupGroupMap() const { return m_mapNameToGroup;};
std::map<RString, std::unordered_set<Group*>> GetSeriesGroupMap() const { return m_mapSeriesToGroup;};
std::unordered_map<RString, Group*> GetGroupGroupMap() const { return m_mapNameToGroup;};
std::map<RString, std::unordered_set<Group*>> GetSeriesGroupMap() const { return m_mapSeriesToGroups;};
Group* GetGroupFromName( const RString &sGroupName ) const;
Group* GetGroup( const Song *pSong ) const;
std::vector<RString> GetPreferredSortSectionNames() const;
@@ -250,8 +250,8 @@ protected:
std::vector<RString> m_sSongGroupBannerPaths; // each song group may have a banner associated with it
//vector<RString> m_sSongGroupBackgroundPaths; // each song group may have a background associated with it (very rarely)
std::map<RString, Group*> m_mapNameToGroup;
std::map<RString, std::unordered_set<Group*>> m_mapSeriesToGroup;
std::unordered_map<RString, Group*> m_mapNameToGroup; // maps a group's name on disk (folder) to a Group object
std::map<RString, std::unordered_set<Group*>> m_mapSeriesToGroups;
struct Comp { bool operator()(const RString& s, const RString &t) const { return CompareRStringsAsc(s,t); } };
typedef std::vector<Song*> SongPointerVector;