Add String::replace_char(s) methods for performance and convenience
This commit is contained in:
@@ -177,7 +177,7 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
|
||||
#ifndef WINDOWS_ENABLED
|
||||
is_same_workspace = root.to_lower() == workspace->root.to_lower();
|
||||
#else
|
||||
is_same_workspace = root.replace("\\", "/").to_lower() == workspace->root.to_lower();
|
||||
is_same_workspace = root.replace_char('\\', '/').to_lower() == workspace->root.to_lower();
|
||||
#endif
|
||||
|
||||
if (root_uri.length() && is_same_workspace) {
|
||||
|
||||
@@ -1939,8 +1939,7 @@ static String marked_documentation(const String &p_bbcode) {
|
||||
line = line.replace("[signal ", "`");
|
||||
line = line.replace("[enum ", "`");
|
||||
line = line.replace("[constant ", "`");
|
||||
line = line.replace("[", "`");
|
||||
line = line.replace("]", "`");
|
||||
line = line.replace_chars("[]", '`');
|
||||
}
|
||||
|
||||
if (!in_code_block && i < lines.size() - 1) {
|
||||
|
||||
@@ -478,7 +478,7 @@ void GDScriptTest::error_handler(void *p_this, const char *p_function, const cha
|
||||
|
||||
if (include_source_info) {
|
||||
header += vformat(" at %s:%d on %s()",
|
||||
String::utf8(p_file).trim_prefix(self->base_dir).replace("\\", "/"),
|
||||
String::utf8(p_file).trim_prefix(self->base_dir).replace_char('\\', '/'),
|
||||
p_line,
|
||||
String::utf8(p_function));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user