perf(assets): drop the spare capacity of the sprite pixel buffer

This commit is contained in:
DanielGodriNeto
2026-10-27 20:39:24 -03:00
parent 795490271d
commit 9042746704
+2
View File
@@ -218,6 +218,8 @@ impl RenderAssets {
sprites.insert(root, &format!("minecraft:block/destroy_stage_{stage}"))?;
}
sprites.finish();
// `finish` grows the buffer by doubling: keep only the bytes in use.
sprites.pixels.shrink_to_fit();
Ok(Self {
sprite_size: sprites.size,
sprite_minimum_size: sprites.minimum_size,