Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:30

0001 // -*- C++ -*-
0002 //
0003 // Package:     CondCore/HDF5ESSource
0004 // Class  :     IOVSyncValue
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Christopher Jones
0010 //         Created:  Tue, 20 Jun 2023 18:20:47 GMT
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "IOVSyncValue.h"
0017 
0018 namespace cond::hdf5 {
0019   std::vector<IOVSyncValue>::const_iterator findMatchingFirst(std::vector<IOVSyncValue> const& iIOVs,
0020                                                               IOVSyncValue iMatch) {
0021     auto itFound = std::lower_bound(iIOVs.begin(), iIOVs.end(), iMatch);
0022     if (itFound == iIOVs.end() or iMatch < *itFound) {
0023       //need to back up one space
0024       if (itFound == iIOVs.begin()) {
0025         return iIOVs.end();
0026       }
0027       itFound -= 1;
0028     }
0029     return itFound;
0030   }
0031 }  // namespace cond::hdf5