Skip to content
Snippets Groups Projects
Commit ff913f6e authored by cranshaw's avatar cranshaw
Browse files

Someone nasty, but effective hack, to remove bad items added in

addItemObjects.


Former-commit-id: 785e4b73
parent 3f744bca
No related branches found
No related tags found
No related merge requests found
......@@ -614,16 +614,24 @@ void AthenaOutputStream::collectAllObjects() {
addItemObjects(*i);
folderclids.push_back(i->id());
}
// FIXME This is a bruteforece hack to remove items erroneously
// added somewhere in the morass of the addItemObjects logic
IDataSelector prunedList;
for (auto it = m_objects.begin(); it != m_objects.end(); ++it) {
if (std::find(folderclids.begin(),folderclids.end(),(*it)->clID())==folderclids.end()) {
m_objects.erase(it);
if (std::find(folderclids.begin(),folderclids.end(),(*it)->clID())!=folderclids.end()) {
prunedList.push_back(*it); // build new list that is correct
}
}
for (auto it = m_objects.begin(); it != m_objects.end(); ++it) {
if (std::find(folderclids.begin(),folderclids.end(),(*it)->clID())==folderclids.end()) {
ATH_MSG_ERROR("Object found that was not in itemlist");
else {
ATH_MSG_DEBUG("Object " << (*it)->clID() <<","<< (*it)->name() << " found that was not in itemlist");
}
}
m_objects.clear(); // clear previous list
//for (auto it = m_objects.begin(); it != m_objects.end(); ++it) {
for (auto it = prunedList.begin(); it != prunedList.end(); ++it) {
ATH_MSG_INFO("GLARB " << (*it)->clID() << " " << (*it)->name());
m_objects.push_back(*it); // copy new into previous
}
}
//FIXME refactor: move this in folder. Treat as composite
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment