From a0dbdcc3abbd3e6307c6e68d0e60f8c0fa31d576 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Mon, 6 May 2024 16:20:20 +0200 Subject: Replace `find` with `contains/has` where applicable * Replaces `find(...) != -1` with `contains` for `String` * Replaces `find(...) == -1` with `!contains` for `String` * Replaces `find(...) != -1` with `has` for containers * Replaces `find(...) == -1` with `!has` for containers --- platform/linuxbsd/os_linuxbsd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/linuxbsd/os_linuxbsd.cpp') diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp index 68b4cd7f5a..6355562feb 100644 --- a/platform/linuxbsd/os_linuxbsd.cpp +++ b/platform/linuxbsd/os_linuxbsd.cpp @@ -184,7 +184,7 @@ String OS_LinuxBSD::get_processor_name() const { while (!f->eof_reached()) { const String line = f->get_line(); - if (line.find("model name") != -1) { + if (line.contains("model name")) { return line.split(":")[1].strip_edges(); } } @@ -269,7 +269,7 @@ String OS_LinuxBSD::get_systemd_os_release_info_value(const String &key) const { if (f.is_valid()) { while (!f->eof_reached()) { const String line = f->get_line(); - if (line.find(key) != -1) { + if (line.contains(key)) { String value = line.split("=")[1].strip_edges(); value = value.trim_prefix("\""); return value.trim_suffix("\""); -- cgit v1.2.3