diff options
author | Matthias Maennich <maennich@google.com> | 2021-07-05 23:34:04 +0100 |
---|---|---|
committer | Liz Kammer <eakammer@google.com> | 2021-07-08 11:30:11 -0400 |
commit | f78e6fa37b62376dd9f81402c6e3ca5ad1d5bf0a (patch) | |
tree | f063845b65abe91ebdf1e475da89712df90ccbae | |
parent | a009d2ae6ae76874bee7421a7d0f69b016ba9009 (diff) | |
download | kati-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.cc | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) { |