From 3eced116f16e16fdf08c65c189ac7b2c1cd83232 Mon Sep 17 00:00:00 2001 From: in2 Date: Sun, 5 Oct 2003 01:03:12 +0000 Subject: use bsearch in login_friend_online() save cpu but increase SHM_t (sizeof(short) * MAX_ACTIVE) bytes WARNING: SHM_t has been changed git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1212 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/friend.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mbbsd/friend.c') diff --git a/mbbsd/friend.c b/mbbsd/friend.c index 8205686d..ab9f1076 100644 --- a/mbbsd/friend.c +++ b/mbbsd/friend.c @@ -271,7 +271,9 @@ friend_load(int type) myfriends[friendcount++] = unum; fclose(fp); } + qsort(myfriends, friendcount, sizeof(int), qsort_intcompar); memcpy(currutmp->friend, myfriends, sizeof(myfriends)); + currutmp->nFriends = friendcount; } if (!type || type & FRIEND_REJECT) { -- cgit v1.2.3