-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Programmability
-
Fully Compatible
-
SP Prioritized List
The code base currently contains many uses of const StringData&, in particular as a function argument. StringData should almost always be passed by value; it is already a view type and is cheap to copy. Passing by value eliminates additional pointer indirections required to pass by reference, and enables the compiler to optimize the code more aggressively.
We should remove all the usages we can of passing by reference and add a lint or static analysis rule to catch it in the future.
- related to
-
SERVER-87848 Add a clang-tidy rule to check for const StringData&
- Closed