mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-21 23:00:06 +02:00
Bug2020: Fix sync-lock groupings
This commit is contained in:
parent
793949aa29
commit
74a360f682
15
src/Track.h
15
src/Track.h
@ -824,6 +824,8 @@ template<typename T>
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template < typename TrackType > struct TrackIterRange;
|
||||||
|
|
||||||
// new track iterators can eliminate the need to cast the result
|
// new track iterators can eliminate the need to cast the result
|
||||||
template <
|
template <
|
||||||
typename TrackType // Track or a subclass, maybe const-qualified
|
typename TrackType // Track or a subclass, maybe const-qualified
|
||||||
@ -978,6 +980,9 @@ private:
|
|||||||
return !this->mPred || this->mPred( pTrack );
|
return !this->mPred || this->mPred( pTrack );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This friendship is needed in TrackIterRange::EndingAfter()
|
||||||
|
friend TrackIterRange< TrackType >;
|
||||||
|
|
||||||
// The class invariant is that mIter == mEnd, or else, mIter != mEnd and
|
// The class invariant is that mIter == mEnd, or else, mIter != mEnd and
|
||||||
// **mIter is of the appropriate subclass and mPred(&**mIter) is true.
|
// **mIter is of the appropriate subclass and mPred(&**mIter) is true.
|
||||||
TrackNodePointer mBegin, mIter, mEnd;
|
TrackNodePointer mBegin, mIter, mEnd;
|
||||||
@ -1060,9 +1065,15 @@ template <
|
|||||||
|
|
||||||
TrackIterRange EndingAfter( const Track *pTrack ) const
|
TrackIterRange EndingAfter( const Track *pTrack ) const
|
||||||
{
|
{
|
||||||
|
const auto newEnd = this->reversal().find( pTrack ).base();
|
||||||
|
// More careful construction is needed so that the independent
|
||||||
|
// increment and decrement of each iterator in the NEW pair
|
||||||
|
// has the expected behavior at boundaries of the range
|
||||||
return {
|
return {
|
||||||
this->first,
|
{ this->first.mBegin, this->first.mIter, newEnd.mIter,
|
||||||
this->reversal().find( pTrack ).base()
|
this->first.GetPredicate() },
|
||||||
|
{ this->first.mBegin, newEnd.mIter, newEnd.mIter,
|
||||||
|
this->second.GetPredicate() }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user