mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 16:40:07 +02:00
More cautions with std::list::iterator on Windows
This commit is contained in:
parent
a30defe8ca
commit
ba61e30cb2
@ -476,17 +476,12 @@ Track *TrackListIterator::RemoveCurrent()
|
|||||||
|
|
||||||
bool TrackListIterator::operator == (const TrackListIterator &other) const
|
bool TrackListIterator::operator == (const TrackListIterator &other) const
|
||||||
{
|
{
|
||||||
if (cur == other.cur)
|
// Order these steps so as not to use operator == on default-constructed
|
||||||
// sufficient but not necessary
|
// std::list::iterator -- that crashes in the MSVC 2013 standard library
|
||||||
return true;
|
|
||||||
|
|
||||||
// Also return true whenever each contains either an end iterator or is
|
|
||||||
// in default-constructed state.
|
|
||||||
bool isEnd = !l || l->isNull( cur );
|
bool isEnd = !l || l->isNull( cur );
|
||||||
if (isEnd)
|
bool otherIsEnd = !other.l || other.l->isNull( other.cur );
|
||||||
return !other.l || other.l->isNull( other.cur );
|
|
||||||
|
|
||||||
return false;
|
return (isEnd == otherIsEnd && (isEnd || cur == other.cur));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user