Skip to content

Commit 764caea

Browse files
committed
fix: remove function all together and make it inline
1 parent d60aa5a commit 764caea

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

toxcore/group_chats.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5020,12 +5020,6 @@ static bool custom_gc_packet_length_is_valid(uint16_t length, bool lossless)
50205020
return true;
50215021
}
50225022

5023-
/** @brief Returns false if a custom incoming (non private) packet is too large. */
5024-
static bool custom_gc_incoming_non_private_packet_length_is_valid(uint16_t length, bool lossless)
5025-
{
5026-
return length <= (lossless ? MAX_GC_CUSTOM_LOSSLESS_INCOMING_ASSEMBLED_PACKET_SIZE : MAX_GC_CUSTOM_LOSSY_PACKET_SIZE);
5027-
}
5028-
50295023
int gc_send_custom_private_packet(const GC_Chat *chat, bool lossless, uint32_t peer_id, const uint8_t *message,
50305024
uint16_t length)
50315025
{
@@ -5124,7 +5118,7 @@ non_null(1, 2, 3, 4) nullable(7)
51245118
static int handle_gc_custom_packet(const GC_Session *c, const GC_Chat *chat, const GC_Peer *peer, const uint8_t *data,
51255119
uint16_t length, bool lossless, void *userdata)
51265120
{
5127-
if (!custom_gc_incoming_non_private_packet_length_is_valid(length, lossless)) {
5121+
if (!(length <= (lossless ? MAX_GC_CUSTOM_LOSSLESS_INCOMING_ASSEMBLED_PACKET_SIZE : MAX_GC_CUSTOM_LOSSY_PACKET_SIZE))) {
51285122
return -1;
51295123
}
51305124

0 commit comments

Comments
 (0)