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

Remove some unneeded headers #680

Merged
merged 4 commits into from
Oct 6, 2024
Merged

Conversation

mjp41
Copy link
Member

@mjp41 mjp41 commented Sep 24, 2024

Towards #670.

@mjp41 mjp41 force-pushed the 20240924-includes branch 2 times, most recently from f1e86d7 to f88be6f Compare September 24, 2024 12:52
This removes some unneeded headers from the headers.
This stack allocates and copies a c-string to replace the calls to std::string.
auto s_indent = std::string(indent);
print(get_dir(true, curr), (s_indent + "|").c_str(), depth + 1);
print(get_dir(false, curr), (s_indent + " ").c_str(), depth + 1);
char s_indent[128];

Choose a reason for hiding this comment

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

Why 128? - Also you might want to use a scoped constant, like enum { size = 128 }; char s_indent[size]

Copy link
Member Author

Choose a reason for hiding this comment

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

@SamuelMarks thanks for your code review. I've added a comment to explain the bound, and made a constexpr for the constant.

@mjp41 mjp41 requested review from SamuelMarks and nwf and removed request for SamuelMarks September 25, 2024 09:30
@mjp41 mjp41 merged commit 97b7675 into microsoft:main Oct 6, 2024
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants