Skip to content

Commit 5d43796

Browse files
generatedunixname89002005287564facebook-github-bot
authored andcommitted
Fix CQS signal. Id] 98468593 -- performance-faster-string-find in fbcode/hphp/runtime/ext/vsdebug
Reviewed By: dtolnay Differential Revision: D74639660 fbshipit-source-id: ba48f7b6b9168ba2f4eb93808c455f988d6a9ac4
1 parent e91e5c1 commit 5d43796

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

hphp/runtime/ext/vsdebug/command.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ std::string VSCommand::trimString(const std::string str) {
145145
}
146146

147147
std::string VSCommand::removeVariableNamePrefix(const std::string& str) {
148-
if (str.find("$") == 0) {
148+
if (str.find('$') == 0) {
149149
return str.substr(1);
150150
} else if (str.find("::$") == 0) {
151151
return str.substr(3);

hphp/runtime/ext/vsdebug/completions_command.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ void CompletionsCommand::addMemberCompletions(
267267
// Don't execute the evaluation if the input string looks like it might
268268
// contain a function call. This could have side effects we don't want to
269269
// cause during auto complete suggestions and it's better to be safe here.
270-
if (context.matchContext.find("(") != std::string::npos ||
271-
context.matchContext.find(")") != std::string::npos ||
270+
if (context.matchContext.find('(') != std::string::npos ||
271+
context.matchContext.find(')') != std::string::npos ||
272272
trimString(context.matchContext).size() == 0) {
273273

274274
return;

0 commit comments

Comments
 (0)