From 52ee9b3be0548e39d35e5d4f2b41f6fdd18565fc Mon Sep 17 00:00:00 2001 From: fukusuket <41001169+fukusuket@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:58:37 +0900 Subject: [PATCH] fix: remove author_list_cache --- src/afterfact.rs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/afterfact.rs b/src/afterfact.rs index a9b74718f..646bae43f 100644 --- a/src/afterfact.rs +++ b/src/afterfact.rs @@ -79,7 +79,6 @@ pub struct AfterfactInfo { pub detected_rule_files: HashSet, pub detected_rule_ids: HashSet, pub detected_computer_and_rule_names: HashSet, - pub author_list_cache: HashMap>, pub prev_message: HashMap, pub prev_details_convert_map: HashMap>, } @@ -145,7 +144,6 @@ impl Default for AfterfactInfo { detected_rule_files: HashSet::new(), detected_rule_ids: HashSet::new(), detected_computer_and_rule_names: HashSet::new(), - author_list_cache: HashMap::new(), prev_message: HashMap::new(), prev_details_convert_map: HashMap::new(), } @@ -522,19 +520,17 @@ fn calc_statistic_info( } if !output_option.no_summary { let level_suffix = get_level_suffix(detect_info.level.as_str()); - let author_list = afterfact_info - .author_list_cache - .entry(detect_info.rulepath.clone()) - .or_insert_with(|| extract_author_name(&detect_info.ruleauthor)) - .clone(); + let author_list = extract_author_name(&detect_info.ruleauthor); let author_str = author_list.iter().join(", "); - afterfact_info - .detect_rule_authors - .insert(detect_info.rulepath.to_owned(), author_str.into()); + afterfact_info.detect_rule_authors.insert( + detect_info.rulepath.to_owned(), + author_str.to_string().into(), + ); - if !afterfact_info - .detected_rule_files - .contains(&detect_info.rulepath) + if author_str != "-" + && !afterfact_info + .detected_rule_files + .contains(&detect_info.rulepath) { afterfact_info .detected_rule_files