[Lldb-commits] [PATCH] D49411: Move from StringRef to std::string in the ScriptInterpreter API
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 17 01:37:32 PDT 2018
labath added a comment.
Normally this would be clearly a good thing, but the added complication here is that this function is part of a class hierarchy, and so this way you are forcing every implementation to take a std::string, even though only one of them cares about null-termination.
In performance-critical code, llvm would use `llvm::Twine` as an argument, which is able to avoid copies if the input string happens to be null-terminated (`toNullTerminatedStringRef`). However, this code is hardly that critical (and ScriptInterpreterPython is the only non-trivial class in the hierarchy), so I don't think it really matters what you do here.
More information about the lldb-commits