Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Next Next commit
fix off by one error in pair auto-parsing skipping
  • Loading branch information
pcanal committed Sep 30, 2020
commit 8d2567b742a015652da4e837242d14f47a9859a6
2 changes: 1 addition & 1 deletion core/foundation/src/TClassEdit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ void TClassEdit::GetNormalizedName(std::string &norm_name, std::string_view name
TClassEdit::TSplitType splitname(norm_name.c_str(),(TClassEdit::EModType)(TClassEdit::kLong64 | TClassEdit::kDropStd | TClassEdit::kDropStlDefault | TClassEdit::kKeepOuterConst));
splitname.ShortType(norm_name, TClassEdit::kDropStd | TClassEdit::kDropStlDefault | TClassEdit::kResolveTypedef | TClassEdit::kKeepOuterConst);

if (splitname.fElements.size() == 3 && (splitname.fElements[0] == "std::pair" || splitname.fElements[0] == "pair")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not a bit fan of == 3 and == 4 without any comment. See also the change in tree/treeplayer/src/TTreeGeneratorBase.cxx

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In TTreeGeneratorBase.cxx, I left 3 or 4 because the likely wrong one was there with no (obvious negative consequence) and (I should add a comment) thus it might actually be the right one .... i.e. to remove it I would have to try to produce a test and the code is used little enough to not be a priority (to spend the time to write the test).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment would be great! :-)

Copy link
Member Author

@pcanal pcanal Sep 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without any comment.

Well that's part of the documented contract of TClassEdit::TSplitType :)

But nevertheless I will add a comment.

if (splitname.fElements.size() == 4 && (splitname.fElements[0] == "std::pair" || splitname.fElements[0] == "pair")) {
// We don't want to lookup the std::pair itself.
std::string first, second;
GetNormalizedName(first, splitname.fElements[1]);
Expand Down