mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Remove dead return statement.
Turning this code: ```c if (cond) { ... return 0; } if (!cond) { ... return 0; } return -1; ``` into: ```c if (cond) { ... return 0; } else { ... return 0; } ``` The `return -1` in the first variant can never happen.
This commit is contained in:
parent
67cf395163
commit
a640ed106a
|
@ -2218,10 +2218,9 @@ static unsigned int lossy_packet_not_received(Group_c *g, int peer_index, uint16
|
|||
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;
|
||||
}
|
||||
|
||||
if (top_distance < MAX_LOSSY_COUNT) {
|
||||
return 0;
|
||||
} else { // top_distance < MAX_LOSSY_COUNT
|
||||
unsigned int i;
|
||||
|
||||
for (i = g->group[peer_index].bottom_lossy_number; i != (g->group[peer_index].bottom_lossy_number + top_distance);
|
||||
|
@ -2232,10 +2231,9 @@ static unsigned int lossy_packet_not_received(Group_c *g, int peer_index, uint16
|
|||
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;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int handle_lossy(void *object, int friendcon_id, const uint8_t *data, uint16_t length, void *userdata)
|
||||
|
|
Loading…
Reference in New Issue
Block a user