perf: slightly optimize Vec usage

This commit is contained in:
2025-03-10 19:58:59 -04:00
parent 2b2cf1d069
commit b2d8618bba
7 changed files with 11 additions and 11 deletions

View File

@@ -41,7 +41,7 @@ pub async fn get_block_states(
lua: Lua,
(block_names, filter_fn): (Vec<String>, Option<Function>),
) -> Result<Vec<u16>> {
let mut matched = Vec::new();
let mut matched = Vec::with_capacity(16);
for block_name in block_names {
for block in
(u32::MIN..u32::MAX).map_while(|possible_id| BlockState::try_from(possible_id).ok())