From fdaa8579f958484796ef79d53c700d4fc1b0bf0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 8 Apr 2023 12:29:43 +0200 Subject: [PATCH] Trade: take Animation::TrackView by a const&. It has 64 bytes, way too much to pass by value. --- src/Magnum/Trade/AnimationData.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Trade/AnimationData.h b/src/Magnum/Trade/AnimationData.h index e1829a961..816fec790 100644 --- a/src/Magnum/Trade/AnimationData.h +++ b/src/Magnum/Trade/AnimationData.h @@ -360,14 +360,14 @@ class AnimationTrackData { /** @todo stop taking TrackViewStorage and instead directly take the key/value views, interpolator/interpolation and extrapolation -- it's just 6 overloads and makes usage much better */ - explicit AnimationTrackData(AnimationTrackType type, AnimationTrackType resultType, AnimationTrackTarget targetName, UnsignedLong target, Animation::TrackViewStorage view) noexcept: _type{type}, _resultType{resultType}, _targetName{targetName}, _target{target}, _view{view} {} + explicit AnimationTrackData(AnimationTrackType type, AnimationTrackType resultType, AnimationTrackTarget targetName, UnsignedLong target, const Animation::TrackViewStorage& view) noexcept: _type{type}, _resultType{resultType}, _targetName{targetName}, _target{target}, _view{view} {} /** @overload * * Equivalent to the above with @p type used as both value type and * result type. */ - explicit AnimationTrackData(AnimationTrackType type, AnimationTrackTarget targetName, UnsignedLong target, Animation::TrackViewStorage view) noexcept: AnimationTrackData{type, type, targetName, target, view} {} + explicit AnimationTrackData(AnimationTrackType type, AnimationTrackTarget targetName, UnsignedLong target, const Animation::TrackViewStorage& view) noexcept: AnimationTrackData{type, type, targetName, target, view} {} /** * @brief Constructor @@ -379,7 +379,7 @@ class AnimationTrackData { * Detects @ref AnimationTrackType from @p view type and delegates to * @ref AnimationTrackData(AnimationTrackType, AnimationTrackType, AnimationTrackTarget, UnsignedLong, Animation::TrackViewStorage). */ - template explicit AnimationTrackData(AnimationTrackTarget targetName, UnsignedLong target, Animation::TrackView view) noexcept; + template explicit AnimationTrackData(AnimationTrackTarget targetName, UnsignedLong target, const Animation::TrackView& view) noexcept; /** * @brief Value type @@ -810,7 +810,7 @@ namespace Implementation { /* LCOV_EXCL_STOP */ } -template inline AnimationTrackData::AnimationTrackData(AnimationTrackTarget targetName, UnsignedLong target, Animation::TrackView view) noexcept: AnimationTrackData{Implementation::animationTypeFor(), Implementation::animationTypeFor(), targetName, target, view} {} +template inline AnimationTrackData::AnimationTrackData(AnimationTrackTarget targetName, UnsignedLong target, const Animation::TrackView& view) noexcept: AnimationTrackData{Implementation::animationTypeFor(), Implementation::animationTypeFor(), targetName, target, view} {} template const Animation::TrackView& AnimationData::track(UnsignedInt id) const { const Animation::TrackViewStorage& storage = track(id);