Skip to content

Commit

Permalink
[Helper] Fix warning in SelectableItem
Browse files Browse the repository at this point in the history
  • Loading branch information
hugtalbot committed Dec 12, 2024
1 parent 6ae972f commit 10083b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sofa/framework/Helper/src/sofa/helper/SelectableItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,16 @@ class SelectableItem : public BaseSelectableItem
template<id_type... Is>
static constexpr id_type findId_impl(const std::string_view key, std::index_sequence<Is...>)
{
constexpr id_type indices[] = { Is... };
id_type result = static_cast<id_type>(-1);
((Derived::s_items[Is].key == key ? (result = Is, true) : false) || ...);
for (id_type i : indices)
{
if (Derived::s_items[i].key == key)
{
result = i;
break;
}
}
return result;
}

Expand Down

0 comments on commit 10083b1

Please sign in to comment.