diff options
author | VolTer <mew.pur.pur@abv.bg> | 2023-01-29 00:52:05 +0100 |
---|---|---|
committer | VolTer <mew.pur.pur@abv.bg> | 2023-05-01 02:27:46 +0200 |
commit | 6b84e258d20e007fd7c95ac2d4f9244bd93edc13 (patch) | |
tree | a99fd73bfdd933775b157122956fe4fbbe656389 /modules/gltf/gltf_document.cpp | |
parent | 10d22a4b35b33ad89f626c261ef7f1aeae81daf3 (diff) | |
download | redot-engine-6b84e258d20e007fd7c95ac2d4f9244bd93edc13.tar.gz |
Use String.repeat() in more places
Diffstat (limited to 'modules/gltf/gltf_document.cpp')
-rw-r--r-- | modules/gltf/gltf_document.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index b243ba933d..3600e5067b 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -6839,9 +6839,9 @@ PackedByteArray GLTFDocument::_serialize_glb_buffer(Ref<GLTFState> p_state, Erro const int32_t header_size = 12; const int32_t chunk_header_size = 8; - for (int32_t pad_i = 0; pad_i < (chunk_header_size + json.utf8().length()) % 4; pad_i++) { - json += " "; - } + int32_t padding = (chunk_header_size + json.utf8().length()) % 4; + json += String(" ").repeat(padding); + CharString cs = json.utf8(); const uint32_t text_chunk_length = cs.length(); |