Skip to content

Remove unnecessary calls to .c_str() #1322

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

Merged
merged 1 commit into from
Jul 15, 2025
Merged

Conversation

DanRStevens
Copy link
Collaborator

No sense to converting from a std::string to a C-string, then back to a new std::string. This wastes time scanning for the length of the C-string to form the new std::string.

The unnecessary use of .c_str() was pointed out by Codacy.

Related:

No sense to converting from a `std::string` to a C-string, then back to a new `std::string`. This wastes time scanning for the length of the C-string to form the new `std::string`.
@DanRStevens DanRStevens merged commit 78ae52f into main Jul 15, 2025
8 checks passed
@DanRStevens DanRStevens deleted the removeUnnecessaryCstr branch July 15, 2025 05:49
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.

1 participant