Skip to content

Commit

Permalink
[df] Early return if empty string in InterpreterCalc
Browse files Browse the repository at this point in the history
  • Loading branch information
vepadulano committed Dec 11, 2024
1 parent 98cb74d commit 2583c32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 2583c32

Please sign in to comment.