delete memset for performance optimization

This commit is contained in:
liuwentan
2023-04-18 16:32:44 +08:00
parent d59e101c9c
commit ff4666ca9d
9 changed files with 0 additions and 21 deletions

View File

@@ -691,7 +691,6 @@ int ip_runtime_scan(struct ip_runtime *ip_rt, int thread_id, int ip_type,
}
struct scan_result ip_results[MAX_SCANNER_HIT_ITEM_NUM];
memset(ip_results, 0, sizeof(ip_results));
/* if ip_addr = "0.0.0.0" means any ip */
int any_ip_flag = 0;
@@ -718,12 +717,10 @@ int ip_runtime_scan(struct ip_runtime *ip_rt, int thread_id, int ip_type,
int ret = 0;
size_t real_hit_index = 0;
long long hit_item_ids[MAX_SCANNER_HIT_ITEM_NUM];
memset(hit_item_ids, -1, sizeof(hit_item_ids));
// any ip, so scan port+proto
if (1 == any_ip_flag) {
struct interval_result port_results[MAX_SCANNER_HIT_ITEM_NUM];
memset(port_results, 0, sizeof(port_results));
uint16_t host_port = ntohs(port);
int n_hit_port_item = interval_matcher_match(ip_rt->intval_matcher, host_port,
port_results, MAX_SCANNER_HIT_ITEM_NUM);