diff --git a/src/chart/animator/keyframe.cpp b/src/chart/animator/keyframe.cpp index 9e8607f4a..5f1cf4ae5 100644 --- a/src/chart/animator/keyframe.cpp +++ b/src/chart/animator/keyframe.cpp @@ -102,19 +102,16 @@ void Keyframe::addMissingMarkers(const Gen::PlotPtr &source, { for (auto i = source->getMarkers().size(); i < target->getMarkers().size(); - ++i) { - auto src = target->getMarkers()[i]; - src.enabled = false; - source->markers.push_back(src); - } + ++i) + source->markers.emplace_back(target->getMarkers()[i]) + .enabled = false; for (auto i = target->getMarkers().size(); i < source->getMarkers().size(); ++i) { if (withTargetCopying) copyTarget(); - auto trg = source->getMarkers()[i]; - trg.enabled = false; - target->markers.push_back(trg); + target->markers.emplace_back(source->getMarkers()[i]) + .enabled = false; } } diff --git a/src/chart/animator/planner.cpp b/src/chart/animator/planner.cpp index 9a8acd68e..178112101 100644 --- a/src/chart/animator/planner.cpp +++ b/src/chart/animator/planner.cpp @@ -258,19 +258,21 @@ void Planner::calcNeeded() && static_cast(trgOpt->legend.get()) && (*srcOpt->legend.get() != *trgOpt->legend.get())); - animNeeded[SectionId::show] = anyMarker( - [&](const auto &source, const auto &target) - { - return static_cast( - !source.enabled && target.enabled); - }); - - animNeeded[SectionId::hide] = anyMarker( - [&](const auto &source, const auto &target) - { - return static_cast( - source.enabled && !target.enabled); - }); + animNeeded[SectionId::show] = + anyMarker(+[](const Gen::Marker &source, + const Gen::Marker &target) -> bool + { + return static_cast( + !source.enabled && target.enabled); + }); + + animNeeded[SectionId::hide] = + anyMarker(+[](const Gen::Marker &source, + const Gen::Marker &target) -> bool + { + return static_cast( + source.enabled && !target.enabled); + }); animNeeded[SectionId::color] = needColor(); @@ -285,19 +287,19 @@ void Planner::calcNeeded() animNeeded[SectionId::x] = needHorizontal(); animNeeded[SectionId::connection] = - anyMarker( - [&](const auto &source, const auto &target) + anyMarker(+[](const Gen::Marker &source, + const Gen::Marker &target) -> bool { - return static_cast( - source.prevMainMarkerIdx + return source.prevMainMarkerIdx != target.prevMainMarkerIdx - || source.mainId != target.mainId); + || source.mainId != target.mainId; }) || srcOpt->isHorizontal() != trgOpt->isHorizontal(); } -bool Planner::anyMarker(const std::function &compare) const +bool Planner::anyMarker( + std::function + &&compare) const { for (auto i = 0U; i < source->getMarkers().size() && i < target->getMarkers().size(); @@ -350,7 +352,8 @@ bool Planner::needColor() const != target->measureAxises.at( Gen::ChannelId::lightness))) || anyMarker( - [&](const auto &source, const auto &target) + [](const Gen::Marker &source, + const Gen::Marker &target) -> bool { return (source.enabled || target.enabled) && source.colorBase != target.colorBase; @@ -419,8 +422,8 @@ bool Planner::needVertical() const || (target->markerConnectionOrientation.value_or( Gen::Orientation::horizontal) == Gen::Orientation::vertical))) - || anyMarker( - [&](const auto &source, const auto &target) + || anyMarker(+[](const Gen::Marker &source, + const Gen::Marker &target) -> bool { return (source.enabled || target.enabled) && (source.position.y != target.position.y @@ -452,7 +455,8 @@ bool Planner::needHorizontal() const Gen::Orientation::vertical) == Gen::Orientation::horizontal))) || anyMarker( - [&](const auto &source, const auto &target) + [](const Gen::Marker &source, + const Gen::Marker &target) -> bool { return (source.enabled || target.enabled) && (source.position.x != target.position.x diff --git a/src/chart/animator/planner.h b/src/chart/animator/planner.h index e55fb23e9..db1a57281 100644 --- a/src/chart/animator/planner.h +++ b/src/chart/animator/planner.h @@ -44,8 +44,9 @@ class Planner : public ::Anim::Group ::Anim::Duration delay = ::Anim::Duration(0), const std::optional<::Anim::Easing> &easing = std::nullopt); - bool anyMarker(const std::function &compare) const; + bool anyMarker( + std::function + &&compare) const; [[nodiscard]] bool positionMorphNeeded() const; [[nodiscard]] bool verticalBeforeHorizontal() const; diff --git a/src/dataframe/old/datatable.h b/src/dataframe/old/datatable.h index 14e38e215..09f070917 100644 --- a/src/dataframe/old/datatable.h +++ b/src/dataframe/old/datatable.h @@ -58,7 +58,7 @@ class DataCube { std::string_view name; std::span categories; - std::size_t size; + std::size_t size{}; }; std::vector dim_reindex;