mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-20 14:52:22 +02:00
vector sizes
streaming wip
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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); }
|
||||
|
||||
Reference in New Issue
Block a user