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

gcc: fix -Wnvro warning #4254

Closed
wants to merge 1 commit into from
Closed

gcc: fix -Wnvro warning #4254

wants to merge 1 commit into from

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Dec 5, 2024

Allows the copiler to elide the copy.

Allows the copiler to elide the copy.

Signed-off-by: Rosen Penev <[email protected]>
@@ -1718,8 +1718,9 @@ auto find_escape(const Char* begin, const Char* end)

inline auto find_escape(const char* begin, const char* end)
-> find_escape_result<char> {
if (const_check(!use_utf8)) return find_escape<char>(begin, end);
auto result = find_escape_result<char>{end, nullptr, 0};
auto result = find_escape<char>(begin, end);
Copy link
Contributor

Choose a reason for hiding this comment

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

is not eliding the 24 byte copy slower than unconditionally calling find_escape<char>?

@vitaut
Copy link
Contributor

vitaut commented Dec 8, 2024

Thanks for the PR but unconditionally calling find_escape does look like a pessimization to me. Closing for now but feel free to reopen with evidence that this is actually an improvement.

@vitaut vitaut closed this Dec 8, 2024
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.

3 participants