Use Span for String.sprintf, to accelerate vformat not needing to allocate an Array.

This commit is contained in:
Lukas Tenbrink
2025-03-10 17:56:14 +01:00
parent 8b4b93a82e
commit a916325e6a
5 changed files with 14 additions and 9 deletions

View File

@@ -30,6 +30,7 @@
#pragma once
#include "core/templates/span.h"
#include "core/typedefs.h"
#include "core/variant/variant_deep_duplicate.h"
@@ -201,6 +202,11 @@ public:
bool is_read_only() const;
static Array create_read_only();
Span<Variant> span() const;
operator Span<Variant>() const {
return this->span();
}
Array(const Array &p_base, uint32_t p_type, const StringName &p_class_name, const Variant &p_script);
Array(const Array &p_from);
Array(std::initializer_list<Variant> p_init);