From e6cbe907ac9605de2ca9294ac15dbfce16991514 Mon Sep 17 00:00:00 2001 From: "zugz (tox)" Date: Tue, 24 Dec 2019 00:00:00 +0000 Subject: [PATCH] refactor --- toxcore/group.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/toxcore/group.c b/toxcore/group.c index 1adaa395..987e2fbd 100644 --- a/toxcore/group.c +++ b/toxcore/group.c @@ -2930,21 +2930,18 @@ static unsigned int lossy_packet_not_received(const Group_c *g, int peer_index, if (top_distance >= MAX_LOSSY_COUNT) { crypto_memzero(g->group[peer_index].recv_lossy, sizeof(g->group[peer_index].recv_lossy)); - g->group[peer_index].top_lossy_number = message_number; - g->group[peer_index].bottom_lossy_number = (message_number - MAX_LOSSY_COUNT) + 1; - g->group[peer_index].recv_lossy[message_number % MAX_LOSSY_COUNT] = 1; } else { // top_distance < MAX_LOSSY_COUNT for (unsigned int i = g->group[peer_index].bottom_lossy_number; i != g->group[peer_index].bottom_lossy_number + top_distance; ++i) { g->group[peer_index].recv_lossy[i % MAX_LOSSY_COUNT] = 0; } - - g->group[peer_index].top_lossy_number = message_number; - g->group[peer_index].bottom_lossy_number = (message_number - MAX_LOSSY_COUNT) + 1; - g->group[peer_index].recv_lossy[message_number % MAX_LOSSY_COUNT] = 1; } + g->group[peer_index].top_lossy_number = message_number; + g->group[peer_index].bottom_lossy_number = (message_number - MAX_LOSSY_COUNT) + 1; + g->group[peer_index].recv_lossy[message_number % MAX_LOSSY_COUNT] = 1; + return 0; }