summaryrefslogtreecommitdiffstats
path: root/modules/gltf/gltf_document.cpp
diff options
context:
space:
mode:
authorVolTer <mew.pur.pur@abv.bg>2023-01-29 00:52:05 +0100
committerVolTer <mew.pur.pur@abv.bg>2023-05-01 02:27:46 +0200
commit6b84e258d20e007fd7c95ac2d4f9244bd93edc13 (patch)
treea99fd73bfdd933775b157122956fe4fbbe656389 /modules/gltf/gltf_document.cpp
parent10d22a4b35b33ad89f626c261ef7f1aeae81daf3 (diff)
downloadredot-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.cpp6
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();