You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not understandable without looking up the implementation which is out of sight here.
auto is here std::optional<BeatsPointer> = std::optional<std::shared_ptr<const Beats>> std::shared_ptr is already optional. So wrapping it into a std::optional is redundant.
Currently the pointer nature is hidden, which may lead to missing null checks.
With this construct we have to deal with nullptr and nullopt.
In case trySetBeats() returns nullptr, the beats are deleted from the track. I don't think this is the desired behaviour here. So let's just remove the optional wrapper.
sometimes (while certainly inefficient) nested optionals are legimitate (see the ColorPalette code), so we need to ensure std::optional(nullptr) and std::nullopt are not treated differently before eliminating the nesting.
In this case tryAdjustTempo() we only have single information transported in the optional state = Successful. Both states he to be treated the same to not remove the old beat grid in the "Unsuccessfull" case in trySetBeats()
The nullptr check is currently missing. @Swiftb0y can you confirm?
auto is here
std::optional<BeatsPointer>
=std::optional<std::shared_ptr<const Beats>>
std::shared_ptr
is already optional. So wrapping it into a std::optional is redundant.Currently the pointer nature is hidden, which may lead to missing null checks.
With this construct we have to deal with nullptr and nullopt.
In case
trySetBeats()
returns nullptr, the beats are deleted from the track. I don't think this is the desired behaviour here. So let's just remove the optional wrapper.Originally posted by @daschuer in #13330 (comment)
The text was updated successfully, but these errors were encountered: