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

config_path(): return a reference #438

Merged
merged 1 commit into from
Aug 18, 2024

Conversation

madsbk
Copy link
Member

@madsbk madsbk commented Aug 15, 2024

Avoid a string copy

@madsbk madsbk added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Aug 15, 2024
@madsbk madsbk marked this pull request as ready for review August 15, 2024 14:08
@madsbk madsbk requested a review from a team as a code owner August 15, 2024 14:08
@madsbk
Copy link
Member Author

madsbk commented Aug 18, 2024

/merge

@rapids-bot rapids-bot bot merged commit e458be4 into rapidsai:branch-24.10 Aug 18, 2024
48 checks passed
@madsbk madsbk deleted the config_cleanup branch August 20, 2024 06:38
Comment on lines 27 to 29
const char* env = std::getenv("CUFILE_ENV_PATH_JSON");
if (env != nullptr && std::filesystem::exists(env)) { return env; }
if (std::filesystem::exists("/etc/cufile.json")) { return "/etc/cufile.json"; }
Copy link
Contributor

Choose a reason for hiding this comment

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

side question: could this be done once (e.g. init a local static var)?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is done once, config_path() calls it to assign a static variable

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. I assumed repeated calls because of the optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants