File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -85,26 +85,12 @@ namespace mtconnect::buffer {
85
85
// / @param diMap the map of data item ids to new data item entities
86
86
void updateDataItems (std::unordered_map<std::string, WeakDataItemPtr> &diMap)
87
87
{
88
- std::vector<boost::circular_buffer<observation::ObservationPtr>::iterator> orphanBufferItems;
89
-
90
- auto iter = m_slidingBuffer.begin ();
91
- while ( iter != m_slidingBuffer.end () )
88
+ for (auto &o : m_slidingBuffer)
92
89
{
93
- observation::ObservationPtr o = *iter;
94
90
if ( o->isOrphan () ) {
95
- orphanBufferItems.push_back (iter);
96
- }
97
- else {
98
- o->updateDataItem (diMap);
91
+ continue ;
99
92
}
100
- iter++;
101
- }
102
-
103
- // remove orphans from the slidingBuffer
104
- while (!orphanBufferItems.empty ()) {
105
- auto orphanIterIter = orphanBufferItems.back ();
106
- m_slidingBuffer.erase (orphanIterIter);
107
- orphanBufferItems.pop_back ();
93
+ o->updateDataItem (diMap);
108
94
}
109
95
110
96
// checkpoints will remove orphans from its observations
You can’t perform that action at this time.
0 commit comments