Skip allocations

This commit is contained in:
Antoine Gersant 2024-08-09 08:27:09 -07:00
parent 2cbb249c46
commit 782da35a7b
3 changed files with 4 additions and 1 deletions

1
Cargo.lock generated
View file

@ -1657,6 +1657,7 @@ dependencies = [
"simplelog",
"sqlx",
"thiserror",
"tinyvec",
"tokio",
"tokio-util",
"toml 0.8.19",

View file

@ -37,6 +37,7 @@ serde = { version = "1.0.147", features = ["derive"] }
serde_derive = "1.0.147"
serde_json = "1.0.122"
simplelog = "0.12.2"
tinyvec = "1.8.0"
thiserror = "1.0.62"
tokio = { version = "1.39", features = ["macros", "rt-multi-thread"] }
tokio-util = { version = "0.7.11", features = ["io"] }

View file

@ -7,6 +7,7 @@ use std::{
use lasso2::ThreadedRodeo;
use serde::{Deserialize, Serialize};
use tinyvec::TinyVec;
use trie_rs::{Trie, TrieBuilder};
use crate::app::index::{InternPath, PathID};
@ -139,7 +140,7 @@ impl Builder {
song.virtual_path
.components()
.map(|c| strings.get_or_intern(c.as_os_str().to_str().unwrap()))
.collect::<Vec<_>>(),
.collect::<TinyVec<[lasso2::Spur; 8]>>(),
);
}