Skip to content

fix: Remove unnecessary std::move from temporary objects in Text struct #2090

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
Mar 10, 2025

Conversation

qnixsynapse
Copy link
Contributor

Describe Your Changes

  • This pull request addresses a compiler warning related to moving temporary objects in the Text struct's annotation parsing logic. The changes involve removing std::move calls from the assignment of temporary strings returned by asString() for both the type and annotation_text variables.

Using std::move on temporary objects can prevent copy elision and lead to potential issues in the code. By directly assigning the result of asString() to the respective variables, we ensure that the code is cleaner and free from unnecessary moves, thus keeping the compiler happy.

@qnixsynapse qnixsynapse merged commit d1dccf3 into dev Mar 10, 2025
8 checks passed
@qnixsynapse qnixsynapse deleted the remove_move branch March 10, 2025 08:45
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