Fix the findByName function.
This commit is contained in:
parent
fa546865a0
commit
dd223026a0
|
@ -52,10 +52,11 @@ protected:
|
|||
public:
|
||||
IS(StandardComponents::NamedIdentifier)
|
||||
optional<reference_wrapper<T>> findByName(const string& name) {
|
||||
auto identifiers = findById<StandardComponents::NamedIdentifier>();
|
||||
for (const auto& identifier: identifiers) {
|
||||
if (identifier.name == name) {
|
||||
return identifier;
|
||||
auto identifiers = findById<T>();
|
||||
for (auto&& identifier: identifiers) {
|
||||
if (identifier.getId() == typeid(T) && identifier.name == name) {
|
||||
return make_optional(reference_wrapper<T>(identifier));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return optional<reference_wrapper<T>>();
|
||||
|
|
Loading…
Reference in New Issue