Some optimizations, optional value compression for BPlustree

This commit is contained in:
euzu
2024-10-30 11:14:55 +01:00
parent 9339674721
commit e5173ad903
23 changed files with 333 additions and 372 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ use crate::utils::string_utils;
#[inline]
fn token_value(it: &mut std::str::Chars) -> String {
// Use .find() to skip until the first double quote (") character.
if it.find(|&ch| ch == '"').is_some() {
if it.any(|ch| ch == '"') {
// If a quote is found, call get_value to extract the value.
return get_value(it);
}
@@ -93,7 +93,7 @@ macro_rules! process_header_fields {
};
}
fn process_header(input: &ConfigInput, video_suffixes: &Vec<&str>, content: &str, url: &str) -> PlaylistItemHeader {
fn process_header(input: &ConfigInput, video_suffixes: &[&str], content: &str, url: &str) -> PlaylistItemHeader {
let mut plih = create_empty_playlistitem_header(input.id, url);
let mut it = content.chars();
let line_token = token_till(&mut it, ':', false);
@@ -186,7 +186,7 @@ where
continue;
}
if let Some(header_value) = header {
let item = PlaylistItem { header: RefCell::new(process_header(input, &video_suffixes, &header_value, &line)) };
let item = PlaylistItem { header: RefCell::new(process_header(input, &video_suffixes, &header_value, line)) };
let mut header = item.header.borrow_mut();
if header.group.is_empty() {
if let Some(group_value) = group {