Skip to content

Commit

Permalink
changed hashmap library to tuneup #368 (#369)
Browse files Browse the repository at this point in the history
* added color code emit_csv test

* replaced HashMap and HashSet to hashbrown #368

* removed debug output in test #368

* fixed colored test
  • Loading branch information
hitenkoku committed Feb 8, 2022
1 parent 84de8d0 commit df30adf
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/detections/detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use crate::detections::utils::get_serde_number_to_string;
use crate::filter;
use crate::yaml::ParseYaml;
use hashbrown;
use hashbrown::HashMap;
use serde_json::Value;
use std::collections::HashMap;
use std::io::BufWriter;
use std::sync::Arc;
use tokio::{runtime::Runtime, spawn, task::JoinHandle};
Expand Down
3 changes: 2 additions & 1 deletion src/detections/rule/condition_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use self::selectionnodes::{
AndSelectionNode, NotSelectionNode, OrSelectionNode, RefSelectionNode, SelectionNode,
};
use super::selectionnodes;
use std::{collections::HashMap, sync::Arc};
use hashbrown::HashMap;
use std::sync::Arc;

lazy_static! {
pub static ref CONDITION_REGEXMAP: Vec<Regex> = vec![
Expand Down
3 changes: 2 additions & 1 deletion src/detections/rule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use crate::detections::print::Message;

use chrono::{DateTime, Utc};

use std::{collections::HashMap, fmt::Debug, sync::Arc, vec};
use hashbrown::HashMap;
use std::{fmt::Debug, sync::Arc, vec};

use yaml_rust::Yaml;

Expand Down
2 changes: 1 addition & 1 deletion src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use crate::detections::configs;
use crate::detections::print::AlertMessage;
use crate::detections::print::ERROR_LOG_STACK;
use crate::detections::print::QUIET_ERRORS_FLAG;
use hashbrown::HashSet;
use lazy_static::lazy_static;
use regex::Regex;
use std::collections::HashSet;
use std::fs::File;
use std::io::BufWriter;
use std::io::{BufRead, BufReader};
Expand Down
2 changes: 1 addition & 1 deletion src/timeline/statistics.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::detections::{configs, detection::EvtxRecordInfo, utils};
use std::collections::HashMap;
use hashbrown::HashMap;

#[derive(Debug)]
pub struct EventStatistics {
Expand Down
2 changes: 1 addition & 1 deletion src/timeline/timeline.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::detections::{configs, detection::EvtxRecordInfo};

use super::statistics::EventStatistics;
use std::collections::HashMap;
use hashbrown::HashMap;

#[derive(Debug)]
pub struct Timeline {
Expand Down
4 changes: 2 additions & 2 deletions src/yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::detections::print::AlertMessage;
use crate::detections::print::ERROR_LOG_STACK;
use crate::detections::print::QUIET_ERRORS_FLAG;
use crate::filter::RuleExclude;
use std::collections::HashMap;
use hashbrown::HashMap;
use std::ffi::OsStr;
use std::fs;
use std::io;
Expand Down Expand Up @@ -269,7 +269,7 @@ mod tests {
use crate::filter;
use crate::yaml;
use crate::yaml::RuleExclude;
use std::collections::HashSet;
use hashbrown::HashSet;
use std::path::Path;
use yaml_rust::YamlLoader;

Expand Down

0 comments on commit df30adf

Please sign in to comment.