aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Maennich <maennich@google.com>2021-07-05 23:34:04 +0100
committerLiz Kammer <eakammer@google.com>2021-07-08 11:30:11 -0400
commitf78e6fa37b62376dd9f81402c6e3ca5ad1d5bf0a (patch)
treef063845b65abe91ebdf1e475da89712df90ccbae
parenta009d2ae6ae76874bee7421a7d0f69b016ba9009 (diff)
downloadkati-f78e6fa37b62376dd9f81402c6e3ca5ad1d5bf0a.tar.gz
dep: fix string::find invocations on single character strings
Express the single character as such to use the potentially more efficient overload of string::find. Signed-off-by: Matthias Maennich <maennich@google.com>
-rw-r--r--src/dep.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dep.cc b/src/dep.cc
index e700b40..9c7e103 100644
--- a/src/dep.cc
+++ b/src/dep.cc
@@ -742,7 +742,7 @@ class DepBuilder {
}
if (g_flags.warn_phony_looks_real && n->is_phony &&
- output.str().find("/") != string::npos) {
+ output.str().find('/') != string::npos) {
if (g_flags.werror_phony_looks_real) {
ERROR_LOC(
n->loc,
@@ -779,7 +779,7 @@ class DepBuilder {
done_[output] = n;
if (g_flags.warn_phony_looks_real && n->is_phony &&
- output.str().find("/") != string::npos) {
+ output.str().find('/') != string::npos) {
if (g_flags.werror_phony_looks_real) {
ERROR_LOC(n->loc,
"*** PHONY target \"%s\" looks like a real file (contains "
@@ -819,7 +819,7 @@ class DepBuilder {
bool is_phony = c->is_phony;
if (!is_phony && !c->has_rule && g_flags.top_level_phony) {
- is_phony = input.str().find("/") == string::npos;
+ is_phony = input.str().find('/') == string::npos;
}
if (!n->is_phony && is_phony) {
if (g_flags.werror_real_to_phony) {