Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[df] Early return if empty string in InterpreterCalc #17245

Merged
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions tree/dataframe/inc/ROOT/RDF/Utils.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ void InterpreterDeclare(const std::string &code);

/// Jit code in the interpreter with TInterpreter::Calc, throw in case of errors.
/// The optional `context` parameter, if present, is mentioned in the error message.
/// The pointer returned by the call to TInterpreter::Calc is returned in case of success.
Long64_t InterpreterCalc(const std::string &code, const std::string &context = "");
void InterpreterCalc(const std::string &code, const std::string &context = "");

/// Whether custom column with name colName is an "internal" column such as rdfentry_ or rdfslot_
bool IsInternalColumn(std::string_view colName);
Expand Down
7 changes: 4 additions & 3 deletions tree/dataframe/src/RDFUtils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,11 @@ void InterpreterDeclare(const std::string &code)
}
}

Long64_t InterpreterCalc(const std::string &code, const std::string &context)
void InterpreterCalc(const std::string &code, const std::string &context)
{
if (code.empty())
return;

R__LOG_DEBUG(10, RDFLogChannel()) << "Jitting and executing the following code:\n\n" << code << '\n';

TInterpreter::EErrorCode errorCode(TInterpreter::kNoError); // storage for cling errors
Expand Down Expand Up @@ -374,8 +377,6 @@ Long64_t InterpreterCalc(const std::string &code, const std::string &context)

callCalc(subs);
}

return 0; // we used to forward the return value of Calc, but that's not possible anymore.
}

bool IsInternalColumn(std::string_view colName)
Expand Down
Loading