vector sizes

streaming wip
This commit is contained in:
euzu
2025-01-09 13:31:05 +01:00
parent ca9a8fea79
commit 1718e6d52c
12 changed files with 29 additions and 28 deletions
+2 -2
View File
@@ -42,8 +42,8 @@ where
// Detect and return cycles in the graph
pub fn find_cycles(&self) -> Vec<Vec<K>> {
let mut visited = HashSet::new();
let mut recursion_stack = Vec::new();
let mut cycles = Vec::new();
let mut recursion_stack = Vec::with_capacity(128);
let mut cycles = Vec::with_capacity(128);
for node in self.adjacencies.keys() {
if !visited.contains(node) {
+1 -1
View File
@@ -142,7 +142,7 @@ const ACTIONS: [(XtreamCluster, &str, &str); 3] = [
(XtreamCluster::Series, "get_series_categories", "get_series")];
pub async fn get_xtream_playlist(input: &ConfigInput, working_dir: &str) -> (Vec<PlaylistGroup>, Vec<M3uFilterError>) {
let mut playlist_groups: Vec<PlaylistGroup> = Vec::new();
let mut playlist_groups: Vec<PlaylistGroup> = Vec::with_capacity(128);
let username = input.username.as_ref().map_or("", |v| v);
let password = input.password.as_ref().map_or("", |v| v);
let base_url = format!("{}/player_api.php?username={}&password={}", input.url, username, password);
+1 -1
View File
@@ -64,7 +64,7 @@ pub fn json_iter_array<T: DeserializeOwned, R: Read>(
}
pub fn json_filter_file(file_path: &Path, filter: &HashMap<&str, &str>) -> Vec<serde_json::Value> {
let mut filtered: Vec<serde_json::Value> = Vec::new();
let mut filtered: Vec<serde_json::Value> = Vec::with_capacity(1024);
if !file_path.exists() {
return filtered; // Return early if the file does not exist
}
+1 -1
View File
@@ -9,7 +9,7 @@ pub struct MultiFileReader {
impl MultiFileReader {
pub fn new(paths: &Vec<PathBuf>) -> io::Result<Self> {
let mut files = Vec::new();
let mut files = Vec::with_capacity(paths.len());
for path in paths {
match File::open(path) {
Ok(file) => { files.push(file); }