Skip to content

Commit 1584aff

Browse files
committed
Remove workaround in DCStoDPLconverter
1 parent ee680a7 commit 1584aff

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Detectors/DCS/testWorkflow/DCStoDPLconverter.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,14 @@ o2f::InjectorFunction dcs2dpl(std::unordered_map<DPID, o2h::DataDescription>& dp
6161
for (size_t i = 0; i < parts.Size(); ++i) { // DCS sends only 1 part, but we should be able to receive more
6262
auto nDPCOM = parts.At(i)->GetSize() / sizeof(DPCOM); // number of DPCOM in current part
6363
for (size_t j = 0; j < nDPCOM; j++) {
64-
DPCOM src;
65-
memcpy(&src, reinterpret_cast<char*>(parts.At(i)->GetData()) + j * sizeof(DPCOM), sizeof(DPCOM));
66-
// const auto* src = reinterpret_cast<const DPCOM*>(parts.At(i)->GetData()) + j;
64+
const auto& src = *(reinterpret_cast<const DPCOM*>(parts.At(i)->GetData()) + j);
6765
// do we want to check if this DP was requested ?
6866
auto mapEl = dpid2group.find(src.id);
6967
if (verbose) {
7068
LOG(INFO) << "Received DP " << src.id << " (data = " << src.data << "), matched to output-> " << (mapEl == dpid2group.end() ? "none " : mapEl->second.as<std::string>());
7169
}
7270
if (mapEl != dpid2group.end()) {
73-
auto& dst = cache[src.id]; // this is needed in case in the 1s window we get a new value for the same DP
74-
memcpy(&dst, &src, sizeof(DPCOM));
71+
auto& dst = cache[src.id] = src; // this is needed in case in the 1s window we get a new value for the same DP
7572
}
7673
}
7774
}

0 commit comments

Comments
 (0)