[llvm-branch-commits] [lldb] 869f836 - [lldb][NFC] Apply performance-faster-string-find (`str.find("X")` -> `str.find('x')`)
Jordan Rupprecht via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Dec 16 11:03:31 PST 2020
Author: Jordan Rupprecht
Date: 2020-12-16T10:53:18-08:00
New Revision: 869f8363c424592e5f8c258492f46d5fcbc90c83
URL: https://github.com/llvm/llvm-project/commit/869f8363c424592e5f8c258492f46d5fcbc90c83
DIFF: https://github.com/llvm/llvm-project/commit/869f8363c424592e5f8c258492f46d5fcbc90c83.diff
LOG: [lldb][NFC] Apply performance-faster-string-find (`str.find("X")` -> `str.find('x')`)
Added:
Modified:
lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp
lldb/tools/lldb-vscode/JSONUtils.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp b/lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp
index 72d28c347457..99784bd3dbd1 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp
@@ -114,7 +114,7 @@ InstrumentationRuntimeMainThreadChecker::RetrieveReportData(
std::string className = "";
std::string selector = "";
if (apiName.substr(0, 2) == "-[") {
- size_t spacePos = apiName.find(" ");
+ size_t spacePos = apiName.find(' ');
if (spacePos != std::string::npos) {
className = apiName.substr(2, spacePos - 2);
selector = apiName.substr(spacePos + 1, apiName.length() - spacePos - 2);
diff --git a/lldb/tools/lldb-vscode/JSONUtils.cpp b/lldb/tools/lldb-vscode/JSONUtils.cpp
index 044bfd13ec46..831f3285d31f 100644
--- a/lldb/tools/lldb-vscode/JSONUtils.cpp
+++ b/lldb/tools/lldb-vscode/JSONUtils.cpp
@@ -1027,7 +1027,7 @@ CreateRunInTerminalReverseRequest(const llvm::json::Object &launch_request) {
std::vector<std::string> envs = GetStrings(launch_request_arguments, "env");
llvm::json::Object environment;
for (const std::string &env : envs) {
- size_t index = env.find("=");
+ size_t index = env.find('=');
environment.try_emplace(env.substr(0, index), env.substr(index + 1));
}
run_in_terminal_args.try_emplace("env",
More information about the llvm-branch-commits
mailing list