X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fq.c;h=a16d1b380753ef197c64d5594179ca2dfd6319de;hp=8971616a617df96619035e39f20ffbd63209334a;hb=2c719855eac434f01d47ba0717d76de65939d74e;hpb=2ddfa640af28b592ecf4295f0b1b7b43c923f707 diff --git a/lib/q.c b/lib/q.c index 8971616..a16d1b3 100644 --- a/lib/q.c +++ b/lib/q.c @@ -1340,10 +1340,12 @@ void mtf_increase(mtf_t*m, const void*key) while(item) { if(m->type->equals(item->key, key)) { item->num++; - if(last) last->next = item->next; - else m->first = item->next; - item->next = m->first; - m->first = item; + if(item->num>m->first->num) { + if(last) last->next = item->next; + else m->first = item->next; + item->next = m->first; + m->first = item; + } return; } last = item;