Skip to content

Commit

Permalink
chore: Port a for-loop to std::any_of
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsergio committed Jul 10, 2024
1 parent e0502bc commit 2e40136
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/Position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ Core::Item *Position::layoutItem() const

bool Position::containsPlaceholder(Core::Item *item) const
{
for (const auto &itemRef : m_placeholders)
if (itemRef->item == item)
return true;

return false;
return std::any_of(m_placeholders.cbegin(), m_placeholders.cend(), [item](const auto &itemRef) {
return itemRef->item == item;
});
}

void Position::removePlaceholders()
Expand Down

0 comments on commit 2e40136

Please sign in to comment.