Skip to content

Remove redundant strings copying and to/from c_str() conversions

  1. Remove missing const-reference qualifications when passing around and handling string arguments in commands (especially in *Command::InitialPass functions)
  2. Factor out unused variables in some places
  3. Get rid of explicit std::basic_string usage in cmSystemTools. Replace with std::string.
  4. Extract variable referencing args[i] in some cases to avoid excessive copy-paste usage (also in InitialPass)

Not all CMake sources are surely inspected deeply enough. There are still many copy-paste things around and other things to be refactored, I am aiming to refactor these step by step as aggregating all the changes in one MR is somewhat hard to observe. Please point me if I am wrong and this work needs to be done in a single batch.

Topic-rename: reduce-string-copying

Merge request reports