This repository was archived by the owner on Jan 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -456,21 +456,21 @@ bool CoordinateTransform::Iterator::operator!=(const Iterator& it)
456456
457457bool CoordinateTransform::Iterator::operator ==(const Iterator& it)
458458{
459- if (m_target_shape != it.m_target_shape )
459+ if (it.m_oob )
460460 {
461- return false ;
462- }
461+ // Out-of-bounds iterators are always equal; in other words, an iterator is always equal to
462+ // end() even if the internally stored coordinates are different.
463463
464- // Out-of-bounds iterators are always equal; in other words, an iterator is always equal to
465- // end() even if the internally stored coordinates are different.
466- if (m_oob && it.m_oob )
464+ // If one iterator is out of bounds and the other is not, they are unequal even if their
465+ // target coordinates happen to match.
466+ return m_oob;
467+ }
468+ else if (m_oob)
467469 {
468- return true ;
470+ return false ;
469471 }
470472
471- // If one iterator is out of bounds and the other is not, they are unequal even if their target
472- // coordinates happen to match.
473- if (m_oob != it.m_oob )
473+ if (m_target_shape != it.m_target_shape )
474474 {
475475 return false ;
476476 }
You can’t perform that action at this time.
0 commit comments