@@ -606,8 +606,7 @@ void importAnalysis(const JSONNode &rootnode, const JSONNode &analysisNode, cons
606606 std::vector<std::string> nllDistNames = valsToStringVec ((*nllNode)[" distributions" ]);
607607 RooArgSet extConstraints;
608608 for (auto &nameNode : (*nllNode)[" aux_distributions" ].children ()) {
609- RooAbsArg *extConstraint = workspace.arg (nameNode.val ());
610- if (extConstraint) {
609+ if (RooAbsArg *extConstraint = workspace.arg (nameNode.val ())) {
611610 extConstraints.add (*extConstraint);
612611 }
613612 }
@@ -989,9 +988,7 @@ void RooJSONFactoryWSTool::exportObject(RooAbsArg const &func, std::set<std::str
989988 if (auto simPdf = dynamic_cast <RooSimultaneous const *>(&func)) {
990989 // RooSimultaneous is not used in the HS3 standard, we only export the
991990 // dependents and some ROOT internal information.
992- for (RooAbsArg *s : func.servers ()) {
993- this ->exportObject (*s, exportedObjectNames);
994- }
991+ exportObjects (func.servers (), exportedObjectNames);
995992
996993 std::vector<std::string> channelNames;
997994 for (auto const &item : simPdf->indexCat ()) {
@@ -1040,13 +1037,9 @@ void RooJSONFactoryWSTool::exportObject(RooAbsArg const &func, std::set<std::str
10401037 continue ;
10411038 }
10421039 if (exp->autoExportDependants ()) {
1043- for (RooAbsArg *s : func.servers ()) {
1044- this ->exportObject (*s, exportedObjectNames);
1045- }
1040+ exportObjects (func.servers (), exportedObjectNames);
10461041 } else {
1047- for (RooAbsArg const *s : _serversToExport) {
1048- this ->exportObject (*s, exportedObjectNames);
1049- }
1042+ exportObjects (_serversToExport, exportedObjectNames);
10501043 }
10511044 return ;
10521045 }
@@ -1758,9 +1751,7 @@ void RooJSONFactoryWSTool::exportAllObjects(JSONNode &n)
17581751 }
17591752 sortByName (allpdfs);
17601753 std::set<std::string> exportedObjectNames;
1761- for (RooAbsPdf *p : allpdfs) {
1762- this ->exportObject (*p, exportedObjectNames);
1763- }
1754+ exportObjects (allpdfs, exportedObjectNames);
17641755
17651756 // export attributes of all objects
17661757 for (RooAbsArg *arg : _workspace.components ()) {
0 commit comments