Skip to content

Commit

Permalink
Use set to add AR_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
MorganSchmitz committed May 17, 2021
1 parent 131592b commit 5030591
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/table/io/OutputArchive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,8 @@ class OutputArchive::Impl {
"All catalogs passed to saveCatalog must be created by makeCatalog");
}
// Add the name of the class to the header so anyone looking at it can
// tell what's stored there. But we don't want to add it multiple times.
try {
auto names = iter->getTable()->getMetadata()->getArray<std::string>("AR_NAME");
if (std::find(names.begin(), names.end(), name) == names.end()) {
iter->getTable()->getMetadata()->add("AR_NAME", name, "Class name for objects stored here");
}
} catch (pex::exceptions::NotFoundError &) {
iter->getTable()->getMetadata()->add("AR_NAME", name, "Class name for objects stored here");
}
// tell what's stored there.
iter->getTable()->getMetadata()->set("AR_NAME", name, "Class name for objects stored here");
// Also add it as the EXTNAME.
iter->getTable()->getMetadata()->set("EXTNAME", name);
indexRecord->set(indexKeys.row0, iter->size());
Expand Down

0 comments on commit 5030591

Please sign in to comment.