From 21aaf2fec7657104e54d14390fd5e3b9045c4faf Mon Sep 17 00:00:00 2001 From: kcwu Date: Sun, 12 Mar 2006 16:03:19 +0000 Subject: avoid unnecessary linear scan if LOCK_THIS. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3277 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/cal.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/cal.c b/mbbsd/cal.c index a180a182..100786b6 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -26,14 +26,14 @@ lockutmpmode(int unmode, int state) int errorno = 0; if (currutmp->lockmode) - errorno = 1; - else if (is_playing(unmode)) - errorno = 2; + errorno = LOCK_THIS; + else if (state == LOCK_MULTI && is_playing(unmode)) + errorno = LOCK_MULTI; - if (errorno && !(state == LOCK_THIS && errorno == LOCK_MULTI)) { + if (errorno) { clear(); move(10, 20); - if (errorno == 1) + if (errorno == LOCK_THIS) prints("請先離開 %s 才能再 %s ", ModeTypeTable[currutmp->lockmode], ModeTypeTable[unmode]); -- cgit v1.2.3