summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-11-18 14:59:45 +0200
committermonty@mashka.mysql.fi <>2002-11-18 14:59:45 +0200
commit0d0bf207c4b7e987ac4daf6ea0d44434ee4e30ce (patch)
tree7f348074683931ade828cf469b5df502087402bf /mysys
parent5563f67c5e282be0161ac7587b28d26143a416e0 (diff)
downloadmariadb-git-0d0bf207c4b7e987ac4daf6ea0d44434ee4e30ce.tar.gz
Small change to make key cache code cleaer
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_keycache.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 5b8ec96b4d1..d5b0a0a056a 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -548,13 +548,14 @@ int flush_key_blocks(File file, enum flush_type type)
count++;
}
/* Only allocate a new buffer if its bigger than the one we have */
- if (count <= FLUSH_CACHE ||
- !(cache=(SEC_LINK**) my_malloc(sizeof(SEC_LINK*)*count,MYF(0))))
+ if (count > FLUSH_CACHE)
{
- cache=cache_buff; /* Fall back to safe buffer */
- count=FLUSH_CACHE;
+ if (!(cache=(SEC_LINK**) my_malloc(sizeof(SEC_LINK*)*count,MYF(0))))
+ {
+ cache=cache_buff; /* Fall back to safe buffer */
+ count=FLUSH_CACHE;
+ }
}
- end=cache+count;
}
/* Go through the keys and write them to buffer to be flushed */