forked from qt-creator/qt-creator
QmlDesigner: Cleanup QmlTimelineKeyframeGroup
Many checks are not anymore need so we can just remove the code and make it clean what we want. Use the filtered algorithm to remove some loops. We add Utils::filteredCast to algorithm.h to return a different result container and let it be cast in std::copy_if. Change-Id: I114c17cd2d5a69c9ebbfbd804805c4d2fa0599e1 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -890,6 +890,17 @@ C filtered(const C &container, R (S::*predicate)() const)
|
||||
return out;
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// filteredCast
|
||||
/////////////////
|
||||
template<typename R, typename C, typename F>
|
||||
Q_REQUIRED_RESULT R filteredCast(const C &container, F predicate)
|
||||
{
|
||||
R out;
|
||||
std::copy_if(std::begin(container), std::end(container), inserter(out), predicate);
|
||||
return out;
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// partition
|
||||
/////////////////
|
||||
|
||||
Reference in New Issue
Block a user