summaryrefslogtreecommitdiffstats
path: root/scene/resources/font.cpp
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-11-16 18:52:15 +0100
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-11-17 10:02:18 +0100
commit68f638cf02cc595872c1a35b78cb1ce0039b1eef (patch)
tree311896361f77ee440b3bfd4c5b2f19f344f88333 /scene/resources/font.cpp
parent5efd124ca10bf46df62fa2441d80589777e54a5a (diff)
downloadredot-engine-68f638cf02cc595872c1a35b78cb1ce0039b1eef.tar.gz
Use `(r)find_char` instead of `(r)find` for single characters
Diffstat (limited to 'scene/resources/font.cpp')
-rw-r--r--scene/resources/font.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index a4677d917d..ae70443e6a 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -1734,7 +1734,7 @@ Error FontFile::_load_bitmap_font(const String &p_path, List<String> *r_image_fi
while (true) {
String line = f->get_line();
- int delimiter = line.find(" ");
+ int delimiter = line.find_char(' ');
String type = line.substr(0, delimiter);
int pos = delimiter + 1;
HashMap<String, String> keys;
@@ -1744,7 +1744,7 @@ Error FontFile::_load_bitmap_font(const String &p_path, List<String> *r_image_fi
}
while (pos < line.size()) {
- int eq = line.find("=", pos);
+ int eq = line.find_char('=', pos);
if (eq == -1) {
break;
}
@@ -1752,14 +1752,14 @@ Error FontFile::_load_bitmap_font(const String &p_path, List<String> *r_image_fi
int end = -1;
String value;
if (line[eq + 1] == '"') {
- end = line.find("\"", eq + 2);
+ end = line.find_char('"', eq + 2);
if (end == -1) {
break;
}
value = line.substr(eq + 2, end - 1 - eq - 1);
pos = end + 1;
} else {
- end = line.find(" ", eq + 1);
+ end = line.find_char(' ', eq + 1);
if (end == -1) {
end = line.size();
}