From 6fcdfc378c2f926ed5a175326fe799844c1c80b2 Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Wed, 26 Apr 2023 15:01:12 -0700 Subject: [lldb] Change return type of FileSpec::GetFileNameExtension These don't really need to be in ConstStrings. It's nice that comparing ConstStrings is fast (just a pointer comparison) but the cost of creating the ConstString usually already includes the cost of doing a StringRef comparison anyway, so this is just extra work and extra memory consumption for basically no benefit. Differential Revision: https://reviews.llvm.org/D149300 --- .../source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 6472a93..3af3c87 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -306,7 +306,7 @@ void ScriptInterpreterPython::SharedLibraryDirectoryHelper( // On windows, we need to manually back out of the python tree, and go into // the bin directory. This is pretty much the inverse of what ComputePythonDir // does. - if (this_file.GetFileNameExtension() == ConstString(".pyd")) { + if (this_file.GetFileNameExtension() == ".pyd") { this_file.RemoveLastPathComponent(); // _lldb.pyd or _lldb_d.pyd this_file.RemoveLastPathComponent(); // lldb llvm::StringRef libdir = LLDB_PYTHON_RELATIVE_LIBDIR; -- cgit v1.1