Skip to content

Remove unnecessary std::move when constructing RapidYamlError#1306

Merged
johnbartholomew merged 1 commit intogoogle:masterfrom
johnbartholomew:unnecessary-move
Mar 13, 2026
Merged

Remove unnecessary std::move when constructing RapidYamlError#1306
johnbartholomew merged 1 commit intogoogle:masterfrom
johnbartholomew:unnecessary-move

Conversation

@johnbartholomew
Copy link
Collaborator

From a compile warning:

jsonnet/core/vm.cpp:3484:30: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
 3484 |         throw RapidYamlError(std::move(msg.str()));
      |                              ^
jsonnet/core/vm.cpp:3484:30: note: remove std::move call here
 3484 |         throw RapidYamlError(std::move(msg.str()));

From a compile warning:

jsonnet/core/vm.cpp:3484:30: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
 3484 |         throw RapidYamlError(std::move(msg.str()));
      |                              ^
jsonnet/core/vm.cpp:3484:30: note: remove std::move call here
 3484 |         throw RapidYamlError(std::move(msg.str()));
@johnbartholomew johnbartholomew merged commit 6a035d9 into google:master Mar 13, 2026
16 checks passed
@johnbartholomew johnbartholomew deleted the unnecessary-move branch March 13, 2026 14:31
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