Skip to content

Commit e6a33aa

Browse files
committed
refactor
1 parent 977e732 commit e6a33aa

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/libprojectM/PresetLoader.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,7 @@ const std::vector<std::string> &PresetLoader::getPresetNames() const
159159
// Get the preset index given a name
160160
const unsigned int PresetLoader::getPresetIndex(std::string &name) const
161161
{
162-
//Need a better structure than a vector for reverse lookup
163-
for (int index = 0; index < _presetNames.size(); index++)
164-
{
165-
if (_presetNames[index] == name) return index;
166-
}
167-
return 0;
162+
return find(_presetNames.begin(), _presetNames.end(), name) - _presetNames.begin();
168163
}
169164

170165
int PresetLoader::getPresetRating ( PresetIndex index, const PresetRatingType ratingType ) const

0 commit comments

Comments
 (0)