mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-26 01:18:06 +02:00
Precautions also in TrackIterRange::StaringWith() as in EndingAfter()
This commit is contained in:
parent
74a360f682
commit
26abe0255d
13
src/Track.h
13
src/Track.h
@ -980,7 +980,8 @@ private:
|
|||||||
return !this->mPred || this->mPred( pTrack );
|
return !this->mPred || this->mPred( pTrack );
|
||||||
}
|
}
|
||||||
|
|
||||||
// This friendship is needed in TrackIterRange::EndingAfter()
|
// This friendship is needed in TrackIterRange::StartingWith and
|
||||||
|
// TrackIterRange::EndingAfter()
|
||||||
friend TrackIterRange< TrackType >;
|
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
|
||||||
@ -1057,9 +1058,15 @@ template <
|
|||||||
|
|
||||||
TrackIterRange StartingWith( const Track *pTrack ) const
|
TrackIterRange StartingWith( const Track *pTrack ) const
|
||||||
{
|
{
|
||||||
|
auto newBegin = this->find( pTrack );
|
||||||
|
// 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->find( pTrack ),
|
{ newBegin.mIter, newBegin.mIter, this->second.mEnd,
|
||||||
this->second
|
this->first.GetPredicate() },
|
||||||
|
{ newBegin.mIter, this->second.mEnd, this->second.mEnd,
|
||||||
|
this->second.GetPredicate() }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user