Skip to content

Commit

Permalink
wip property rework
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed Sep 18, 2024
1 parent 1049915 commit 8d75175
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/emulation/coreregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Properties CoreRegistry::IFactoryInfo::variantProperties(const std::string& vari
CoreRegistry::CoreRegistry()
{
for(auto& [key, info] : factoryMap()) {
orderedFactories.emplace_back(key, info.get());
}
std::sort(orderedFactories.begin(), orderedFactories.end(), [](const auto& lhs, const auto& rhs) { return lhs.second->score < rhs.second->score; });
for(auto& [key, info] : orderedFactories) {
if(!coresCombo.empty())
coresCombo += ";";
coresCombo += key;
Expand All @@ -74,9 +78,8 @@ CoreRegistry::CoreRegistry()
supportedExtensions.insert(defaultExtensions.begin(), defaultExtensions.end());
}
}
orderedFactories.emplace_back(key, info.get());

}
std::sort(orderedFactories.begin(), orderedFactories.end(), [](const auto& lhs, const auto& rhs) { return lhs.second->score < rhs.second->score; });
}

CoreRegistry::FactoryMap& CoreRegistry::factoryMap()
Expand Down
2 changes: 1 addition & 1 deletion src/emulation/coreregistry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class CoreRegistry {
{
using iterator_category = std::forward_iterator_tag;
using difference_type = std::ptrdiff_t;
using value_type = std::pair<std::string_view,const IFactoryInfo*>;
using value_type = std::pair<std::string_view,IFactoryInfo*>;
using pointer = value_type*;
using reference = value_type&;
explicit Iterator(std::vector<value_type>::iterator iter) : _iter(iter) {}
Expand Down

0 comments on commit 8d75175

Please sign in to comment.