git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed drawlink() ruby callback
[swftools.git]
/
lib
/
q.c
diff --git
a/lib/q.c
b/lib/q.c
index
8971616
..
a16d1b3
100644
(file)
--- 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++;
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;
return;
}
last = item;