Skip to content

Commit 739128e

Browse files
lukasstraub2jasowang
authored andcommitted
net/colo-compare.c: Optimize removal of secondary packet
g_queue_remove needs to look up the list entry first, but we already have it as result and can remove it directly with g_queue_delete_link. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
1 parent 9162ed6 commit 739128e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/colo-compare.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ static void colo_compare_packet(CompareState *s, Connection *conn,
691691
if (result) {
692692
colo_release_primary_pkt(s, pkt);
693693
packet_destroy(result->data, NULL);
694-
g_queue_remove(&conn->secondary_list, result->data);
694+
g_queue_delete_link(&conn->secondary_list, result);
695695
} else {
696696
/*
697697
* If one packet arrive late, the secondary_list or

0 commit comments

Comments
 (0)