[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: 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 |