Skip to content

Commit 2a5a135

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 368e5f8 commit 2a5a135

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
@@ -183,7 +183,7 @@ static void CopyNode(const RootSource &src, const RootCpDestination &dest, NodeI
183183
// Similarly, nodeIdx must be in range because it always comes from a RootObjTree.
184184
assert(nodeIdx < src.fObjectTree.fNodes.size());
185185
const RootObjNode &node = src.fObjectTree.fNodes[nodeIdx];
186-
const std::string srcFullPath = NodeFullPath(src.fObjectTree, nodeIdx);
186+
const std::string srcFullPath = NodeFullPath(src.fObjectTree, nodeIdx, ENodeFullPathOpt::kExcludeFilename);
187187
// Directory path, excluding trailing '/' and without the "file.root:" prefix.
188188
const std::string_view srcDirPath =
189189
(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)