Skip to content

Commit 45566a0

Browse files
committed
[main] make 3rd argument of ROOT::CmdLine::NodeFullPath explicit
There is really no point in having it implicit and for clarity of intention it's better to spell it out.
1 parent 530d3d8 commit 45566a0

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

main/src/RootObjTree.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ enum class ENodeFullPathOpt {
6969
kIncludeFilename,
7070
};
7171
/// Given a node, returns its full path. If `opt == kIncludeFilename`, the path is prepended by "filename.root:"
72-
std::string
73-
NodeFullPath(const RootObjTree &tree, NodeIdx_t nodeIdx, ENodeFullPathOpt opt = ENodeFullPathOpt::kExcludeFilename);
72+
std::string NodeFullPath(const RootObjTree &tree, NodeIdx_t nodeIdx, ENodeFullPathOpt opt);
7473

7574
struct RootSource {
7675
std::string fFileName;

main/src/rootcp.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void CopyNode(const RootSource &src, const RootCpDestination &dest, NodeI
177177
{
178178
TFile *srcfile = src.fObjectTree.fFile.get();
179179
const RootObjNode &node = src.fObjectTree.fNodes[nodeIdx];
180-
const std::string srcFullPath = NodeFullPath(src.fObjectTree, nodeIdx);
180+
const std::string srcFullPath = NodeFullPath(src.fObjectTree, nodeIdx, ENodeFullPathOpt::kExcludeFilename);
181181
// Directory path, excluding trailing '/' and without the "file.root:" prefix.
182182
const std::string_view srcDirPath =
183183
(node.fParent == 0) ? std::string_view{}

main/src/rootls.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static void RootLs(const RootLsArgs &args, std::ostream &stream = std::cout)
530530
for (NodeIdx_t rootIdx : source.fObjectTree.fDirList) {
531531
if (manySources) {
532532
PrintIndent(stream, outerIndent);
533-
stream << NodeFullPath(source.fObjectTree, rootIdx) << " :\n";
533+
stream << NodeFullPath(source.fObjectTree, rootIdx, ENodeFullPathOpt::kExcludeFilename) << " :\n";
534534
}
535535

536536
if (args.fFlags & (RootLsArgs::kLongListing | RootLsArgs::kTreeListing | RootLsArgs::kRNTupleListing))

0 commit comments

Comments
 (0)