ConstStrings are super cheap to copy around. It is often more expensive
to pass a pointer and potentially dereference it than just to always copy it.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/include/lldb/Core/Module.h | ||
---|---|---|
126–127 | Out of curiosity, what was the rationale for removing the default parameter here? |
lldb/include/lldb/Core/Module.h | ||
---|---|---|
126–127 | I didn't really even think about it, I probably should have just done ConstString object_name = ConstString() or something. | |
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp | ||
806 ↗ | (On Diff #550812) | Yes, although I'll probably make the default value of the parameter be an empty ConstString instead. |
If we're passing it by value, why the const qualifier?