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 <[email protected]>
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 @@
}
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 @@
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 @@
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) {