}
return checksum;
}
+unsigned int crc32_add_bytes(unsigned int checksum, const void*_s, int len)
+{
+ unsigned char*s = (unsigned char*)_s;
+ crc32_init();
+ if(!s || !len)
+ return checksum;
+ do {
+ checksum = checksum>>8 ^ crc32[(*s^checksum)&0xff];
+ s++;
+ } while(--len);
+ return checksum;
+}
unsigned int string_hash(const string_t*str)
{
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;