From: <net...@us...> - 2003-09-06 21:38:36
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv31760 Modified Files: SourceRange.cpp Log Message: -- corrected overlap test Index: SourceRange.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/SourceRange.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SourceRange.cpp 10 May 2003 10:55:38 -0000 1.4 --- SourceRange.cpp 6 Sep 2003 21:38:30 -0000 1.5 *************** *** 94,102 **** SourceRange::overlap( const SourceRange &other ) const { ! if ( other.startIndex_ < startIndex_ && ! other.startIndex_ + other.length_ > startIndex_ ) return true; ! return startIndex_ + length_ > other.startIndex_; } --- 94,105 ---- SourceRange::overlap( const SourceRange &other ) const { ! // other starts is inside this range ! if ( other.startIndex_ >= startIndex_ && ! other.startIndex_ < startIndex_ + length_ ) return true; ! // other ends inside this range: ! return other.startIndex_ + other.length_ >= startIndex_ && ! other.startIndex_ + other.length_ < startIndex_ + length_; } |