Make sure that TimePeriod segments are being merged properly.

Refs #5268
This commit is contained in:
Gunnar Beutner 2013-12-05 12:30:02 +01:00
parent fa14b39719
commit e2941dbca8
1 changed files with 2 additions and 2 deletions

View File

@ -70,12 +70,12 @@ void TimePeriod::AddSegment(double begin, double end)
if (segment->Get("begin") <= begin && segment->Get("end") >= end)
return; /* New segment is fully contained in this segment. */
if (segment->Get("begin") < begin && segment->Get("end") > begin) {
if (segment->Get("begin") <= begin && segment->Get("end") >= begin) {
segment->Set("end", end); /* Extend an existing segment. */
return;
}
if (segment->Get("begin") > begin && segment->Get("begin") < end) {
if (segment->Get("begin") >= begin && segment->Get("begin") <= end) {
segment->Set("begin", begin); /* Extend an existing segment. */
return;
}