Skip to content

Commit ab1815f

Browse files
authored
Merge pull request cms-sw#33941 from ggovi/condcore-conddb-fix-for-iovarray-120X
Fix for IOV Array Iterator
2 parents ddcf4ec + a2d6cd8 commit ab1815f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

CondCore/CondDB/src/IOVProxy.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,17 @@ namespace cond {
4545
retVal.since = std::get<0>(*m_current);
4646
auto next = m_current;
4747
next++;
48-
48+
if (next == m_parent->m_array->end()) {
49+
retVal.till = cond::time::MAX_VAL;
50+
} else {
51+
retVal.till = cond::time::tillTimeFromNextSince(std::get<0>(*next), m_parent->m_tagInfo.timeType);
52+
}
4953
// default is the end of validity when set...
50-
retVal.till = m_parent->m_tagInfo.endOfValidity;
51-
retVal.till = cond::time::tillTimeFromNextSince(std::get<0>(*next), m_parent->m_tagInfo.timeType);
54+
if (retVal.till > m_parent->m_tagInfo.endOfValidity) {
55+
retVal.till = m_parent->m_tagInfo.endOfValidity;
56+
}
5257
retVal.payloadId = std::get<1>(*m_current);
58+
5359
return retVal;
5460
}
5561

0 commit comments

Comments
 (0)