X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=isam%2Fisam.c;h=380ccecb7f0a33ae0864e3446c553ca8baf9c13f;hb=70961362d71c04daaf0b0feafe59e78d235eb116;hp=d2edbbe01b90a5b0089ec320a34312f136386985;hpb=288e50e499479a436edb71358c51fb8317c26da3;p=idzebra-moved-to-github.git diff --git a/isam/isam.c b/isam/isam.c index d2edbbe..380ccec 100644 --- a/isam/isam.c +++ b/isam/isam.c @@ -4,7 +4,16 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: isam.c,v $ - * Revision 1.19 1996-02-10 12:20:56 quinn + * Revision 1.22 1996-10-29 13:56:53 adam + * Include of zebrautl.h instead of alexutil.h. + * + * Revision 1.21 1996/03/29 14:11:47 quinn + * Change to is_merge + * + * Revision 1.20 1996/03/19 13:14:57 quinn + * Moved an xfree() + * + * Revision 1.19 1996/02/10 12:20:56 quinn * *** empty log message *** * * Revision 1.18 1996/02/06 10:19:56 quinn @@ -67,7 +76,7 @@ #include #include -#include +#include #include #include #include @@ -360,7 +369,6 @@ int is_close(ISAM is) bf_close(is->types[i].bf); } } - xfree(is); if (is->writeflag) { logf(LOG_LOG, "ISAM statistics:"); @@ -383,6 +391,7 @@ int is_close(ISAM is) logf(LOG_LOG, "block_jumps %d", statistics.block_jumps); logf(LOG_LOG, "tab_deletes %d", statistics.tab_deletes); } + xfree(is); return 0; } @@ -473,9 +482,8 @@ ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data) continue; } /* else check if next key can fit in this position */ - is_m_peek_record(&tab, keybuf); - res = (*is->cmp)(data + 1, keybuf); - if (res < 0) + if (is_m_peek_record(&tab, keybuf) && + (*is->cmp)(data + 1, keybuf) < 0) { logf (LOG_DEBUG, "XXReplacing record."); is_m_replace_record(&tab, data + 1);