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

When Char16String or CharString are constructed, call strlen in the header instead of the module. #101349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ivorforce
Copy link
Member

@Ivorforce Ivorforce commented Jan 9, 2025

This allows the compiler to run strlen at compile time (if known then), saving on runtime costs.

This change brings the two classes on-par with String's changes from recently (#100132). The change is less important for Char16String and CharString because it seems there are few callers of these functions in the codebase (if any at all, outside of tests).
However, I'm still proposing the change to bring the two classes on-par with String in this regard. When new changes to String construction behavior are made, it will be easier CharString and Char16String to follow along, to keep the classes consistent.

… the header instead of the module.

This allows the compiler to do it at compile time (if known then).
@Ivorforce Ivorforce force-pushed the string-sidekicks-constexpr-strlen branch from 21235ef to 781a92f Compare March 10, 2025 18:40
@Ivorforce
Copy link
Member Author

Rebased to use Span.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants