removed unnecessary clone process #165

This commit is contained in:
DastInDark
2022-07-29 10:34:42 +09:00
parent d38ac0f273
commit 4d5414a4d7

View File

@@ -158,15 +158,16 @@ pub fn insert(
if exist_detail { if exist_detail {
profile_converter.insert("%Details%".to_string(), detect_info.detail.to_owned()); profile_converter.insert("%Details%".to_string(), detect_info.detail.to_owned());
} }
let mut converted_detect_info = detect_info.clone(); let mut tmp_converted_info : HashMap<String, String> = HashMap::new();
for (k, v) in &detect_info.ext_field { for (k, v) in detect_info.ext_field.iter() {
let converted_reserve_info = convert_profile_reserved_info(v, profile_converter); let converted_reserve_info = convert_profile_reserved_info(v, profile_converter);
converted_detect_info.ext_field.insert( tmp_converted_info.insert(k.to_owned(),
k.to_owned(), parse_message(event_record, &converted_reserve_info));
parse_message(event_record, &converted_reserve_info),
);
} }
insert_message(converted_detect_info, time) for (k, v) in tmp_converted_info {
detect_info.ext_field.insert(k, v);
}
insert_message(detect_info, time)
} }
/// profileで用いられる予約語の情報を変換する関数 /// profileで用いられる予約語の情報を変換する関数