You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add String::remove_char(s) methods for performance and convenience
This commit is contained in:
@@ -863,7 +863,7 @@ GDScriptTokenizer::Token GDScriptTokenizerText::number() {
|
||||
|
||||
// Create a string with the whole number.
|
||||
int len = _current - _start;
|
||||
String number = String(_start, len).replace("_", "");
|
||||
String number = String(_start, len).remove_char('_');
|
||||
|
||||
// Convert to the appropriate literal type.
|
||||
if (base == 16) {
|
||||
|
||||
@@ -695,7 +695,7 @@ const lsp::DocumentSymbol *GDScriptWorkspace::resolve_symbol(const lsp::TextDocu
|
||||
|
||||
} else {
|
||||
ScriptLanguage::LookupResult ret;
|
||||
if (symbol_identifier == "new" && parser->get_lines()[p_doc_pos.position.line].replace(" ", "").replace("\t", "").contains("new(")) {
|
||||
if (symbol_identifier == "new" && parser->get_lines()[p_doc_pos.position.line].remove_chars(" \t").contains("new(")) {
|
||||
symbol_identifier = "_init";
|
||||
}
|
||||
if (OK == GDScriptLanguage::get_singleton()->lookup_code(parser->get_text_for_lookup_symbol(pos, symbol_identifier, p_func_required), symbol_identifier, path, nullptr, ret)) {
|
||||
|
||||
Reference in New Issue
Block a user