Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions roofit/roofitcore/src/RooCmdConfig.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ arguments and dependencies between arguments.
#include <ROOT/StringUtils.hxx>

#include <iostream>

#include <set>

namespace {

Expand Down Expand Up @@ -286,18 +286,24 @@ void RooCmdConfig::print() const
}
}



////////////////////////////////////////////////////////////////////////////////
/// Process given list with RooCmdArgs
/// Emit warning if duplicate arguments

bool RooCmdConfig::process(const RooLinkedList& argList)
{
bool ret(false) ;
for(auto * arg : static_range_cast<RooCmdArg*>(argList)) {
ret |= process(*arg) ;
}
return ret ;
bool ret(false);
std::set<std::string> opcodes;
for (auto *arg : static_range_cast<RooCmdArg *>(argList)) {
auto opc = arg->opcode();
if (opc && opcodes.find(opc) != opcodes.end()) {
coutW(InputArguments) << _name << " WARNING: argument " << opc << " is duplicated" << std::endl;
} else if (opc) {
opcodes.insert(opc);
}
ret |= process(*arg);
}
return ret;
}


Expand Down
Loading