Add assertions that line iterators being compared are iterators over the same line list. rs=dbaron

This commit is contained in:
jwalden@mit.edu 2007-07-10 17:55:15 -07:00
Родитель 178f02522a
Коммит 9c915b9c81
1 изменённых файлов: 24 добавлений и 5 удалений

Просмотреть файл

@ -689,15 +689,34 @@ class nsLineList_iterator {
// Passing by value rather than by reference and reference to const
// to keep AIX happy.
// XXX Should add assertions that |mListLink| is the same for both.
PRBool operator==(const iterator_self_type aOther) const
{ return mCurrent == aOther.mCurrent; }
{
#ifdef NS_LINELIST_DEBUG_PASS_END
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
#endif
return mCurrent == aOther.mCurrent;
}
PRBool operator!=(const iterator_self_type aOther) const
{ return mCurrent != aOther.mCurrent; }
{
#ifdef NS_LINELIST_DEBUG_PASS_END
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
#endif
return mCurrent != aOther.mCurrent;
}
PRBool operator==(const iterator_self_type aOther)
{ return mCurrent == aOther.mCurrent; }
{
#ifdef NS_LINELIST_DEBUG_PASS_END
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
#endif
return mCurrent == aOther.mCurrent;
}
PRBool operator!=(const iterator_self_type aOther)
{ return mCurrent != aOther.mCurrent; }
{
#ifdef NS_LINELIST_DEBUG_PASS_END
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
#endif
return mCurrent != aOther.mCurrent;
}
private:
link_type *mCurrent;