mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
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
This commit is contained in:
parent
281fe39929
commit
a0dbdcc3ab
55 changed files with 219 additions and 219 deletions
|
@ -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("\"");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue