From e719c1472211b92171430447b8e80a1525a83585 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 31 Dec 2023 17:42:05 +0100 Subject: Reformatted player_find() --- FICS/playerdb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/FICS/playerdb.c b/FICS/playerdb.c index 5dcde80..d4bb0a3 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -977,17 +977,17 @@ PUBLIC int player_save(int p) return 0; } -PUBLIC int player_find(int fd) +PUBLIC int +player_find(int fd) { - int i; + for (int i = 0; i < p_num; i++) { + if (parray[i].status == PLAYER_EMPTY) + continue; + if (parray[i].socket == fd) + return i; + } - for (i = 0; i < p_num; i++) { - if (parray[i].status == PLAYER_EMPTY) - continue; - if (parray[i].socket == fd) - return i; - } - return -1; + return -1; } PUBLIC int -- cgit v1.2.3