Skip to content

Commit

Permalink
Optimize StringBuilder append for static strings, and as_string().
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivorforce committed Dec 8, 2024
1 parent f128f38 commit ebf4b31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/string/string_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
#define STRING_BUILDER_H

#include "core/string/ustring.h"
#include "core/templates/vector.h"
#include "core/templates/local_vector.h"

class StringBuilder {
uint32_t string_length = 0;

Vector<String> strings;
Vector<const char *> c_strings;
LocalVector<String> strings;
LocalVector<const char *> c_strings;

// -1 means it's a Godot String
// a natural number means C string.
Vector<int32_t> appended_strings;
LocalVector<int32_t> appended_strings;

public:
StringBuilder &append(const String &p_string);
Expand Down

0 comments on commit ebf4b31

Please sign in to comment.