date_time icon indicating copy to clipboard operation
date_time copied to clipboard

Coverity Scan noted possible issue in period() code

Open jeking3 opened this issue 3 years ago • 0 comments

I have not looked into it, wanted to make sure it got looked at. It's talking about line 304 specifically.

https://scan4.scan.coverity.com/reports.htm#v17121/p13946/fileInstanceId=114637940&defectInstanceId=14388704&mergedDefectId=255065

template<class point_rep, class duration_rep>
299  inline BOOST_CXX14_CONSTEXPR
300  bool period<point_rep,duration_rep>::intersects(const period<point_rep,duration_rep>& other) const
301  { 
   	original: other.begin_ < this->begin_ looks like the original copy.
   	
CID 255065 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)
copy_paste_error: begin_ in other.last_ >= this->begin_ looks like a copy-paste error.
   	Should it say last_ instead?
302    return ( contains(other.begin_) ||
303             other.contains(begin_) ||
304             ((other.begin_ < begin_) && (other.last_ >= begin_)));
305  }
306

jeking3 avatar Mar 01 '22 14:03 jeking3