зеркало из https://github.com/mozilla/pjs.git
Add assertions that line iterators being compared are iterators over the same line list. rs=dbaron
This commit is contained in:
Родитель
178f02522a
Коммит
9c915b9c81
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче