summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-03-13 00:03:19 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-03-13 00:03:19 +0800
commit21aaf2fec7657104e54d14390fd5e3b9045c4faf (patch)
tree3be09ee77b28d37ded64d2d9fd5e584b8a7d5572
parentb729272d521985d2656660d2f83a3a29c8f6ec8f (diff)
downloadpttbbs-21aaf2fec7657104e54d14390fd5e3b9045c4faf.tar
pttbbs-21aaf2fec7657104e54d14390fd5e3b9045c4faf.tar.gz
pttbbs-21aaf2fec7657104e54d14390fd5e3b9045c4faf.tar.bz2
pttbbs-21aaf2fec7657104e54d14390fd5e3b9045c4faf.tar.lz
pttbbs-21aaf2fec7657104e54d14390fd5e3b9045c4faf.tar.xz
pttbbs-21aaf2fec7657104e54d14390fd5e3b9045c4faf.tar.zst
pttbbs-21aaf2fec7657104e54d14390fd5e3b9045c4faf.zip
avoid unnecessary linear scan if LOCK_THIS.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3277 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/cal.c10
1 files changed, 5 insertions, 5 deletions
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]);