Skip to content

Commit 33da2d6

Browse files
committed
Get rid of the clear Method
1 parent 1fd49d8 commit 33da2d6

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

Framework/Core/include/Framework/MessageSet.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct MessageSet {
5151
MessageSet(MessageSet&& other)
5252
: messages(std::move(other.messages))
5353
{
54-
other.clear();
54+
other.messages.clear();
5555
}
5656

5757
MessageSet& operator=(MessageSet&& other)
@@ -60,15 +60,10 @@ struct MessageSet {
6060
return *this;
6161
}
6262
messages = std::move(other.messages);
63-
other.clear();
63+
other.messages.clear();
6464
return *this;
6565
}
6666

67-
/// clear the set
68-
void clear()
69-
{
70-
messages.clear();
71-
}
7267
};
7368

7469
} // namespace o2::framework

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::v
22152215
continue;
22162216
}
22172217
// This will hopefully delete the message.
2218-
currentSetOfInputs[ii].clear();
2218+
currentSetOfInputs[ii].messages.clear();
22192219
}
22202220
};
22212221

Framework/Core/src/DataRelayer.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ void DataRelayer::pruneCache(TimesliceSlot slot, OnDropCallback onDrop)
431431
// will be ignored.
432432
assert(numInputTypes * slot.index < cache.size());
433433
for (size_t ai = slot.index * numInputTypes, ae = ai + numInputTypes; ai != ae; ++ai) {
434-
cache[ai].clear();
434+
cache[ai].messages.clear();
435435
cachedStateMetrics[ai] = CacheEntryStatus::EMPTY;
436436
}
437437
};
@@ -914,7 +914,7 @@ std::vector<o2::framework::MessageSet> DataRelayer::consumeAllInputsForTimeslice
914914
auto invalidateCacheFor = [&numInputTypes, &index, &cache](TimesliceSlot s) {
915915
for (size_t ai = s.index * numInputTypes, ae = ai + numInputTypes; ai != ae; ++ai) {
916916
assert(std::accumulate(cache[ai].messages.begin(), cache[ai].messages.end(), true, [](bool result, auto const& element) { return result && element.get() == nullptr; }));
917-
cache[ai].clear();
917+
cache[ai].messages.clear();
918918
}
919919
index.markAsInvalid(s);
920920
};
@@ -978,7 +978,7 @@ void DataRelayer::clear()
978978
std::scoped_lock<O2_LOCKABLE(std::recursive_mutex)> lock(mMutex);
979979

980980
for (auto& cache : mCache) {
981-
cache.clear();
981+
cache.messages.clear();
982982
}
983983
for (size_t s = 0; s < mTimesliceIndex.size(); ++s) {
984984
mTimesliceIndex.markAsInvalid(TimesliceSlot{s});

0 commit comments

Comments
 (0)