[SERVER-42046] Remove redundant moves from matcher code Created: 02/Jul/19  Updated: 29/Oct/23  Resolved: 14/Aug/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Improvement Priority: Major - P3
Reporter: Jonathan Reams Assignee: Nikita Lapkov (Inactive)
Resolution: Fixed Votes: 0
Labels: neweng, qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2020-08-24
Participants:

 Description   

With gcc 9.1, there are a whole bunch of redundant move warnings/errors in the matcher (see an example here and here).



 Comments   
Comment by Githook User [ 14/Aug/20 ]

Author:

{'name': 'Nikita Lapkov', 'email': 'nikita.lapkov@mongodb.com'}

Message: SERVER-42046: Remove redundant moves from query code

Since C++17 return value optimization is mandatory and no longer considered as copy elision (https://en.cppreference.com/w/cpp/language/copy_elision). This means that in some cases `return std::move(value)` can be replaced with just `return value`. We refactor Query code to remove these redundant moves. GCC 9.0.1 was used to detect such places in codebase
Branch: master
https://github.com/mongodb/mongo/commit/34b1c989ed6e8a3f4f6056efc81367794cfe5398

Generated at Thu Feb 08 04:59:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.