diff options
author | David Härdeman <david@hardeman.nu> | 2007-05-23 00:36:09 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2007-05-23 00:36:09 +0200 |
commit | 08f2d671b0569b062f32908ea36c2dd2a11e420a (patch) | |
tree | 2e38e3dd4ec25f0185de423a3027b578b0ec9564 | |
parent | 1c32a11b0987898a9ea52d4b0d7b44056c9b4c9b (diff) |
Simplify mentry_insert
-rw-r--r-- | metaentry.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/metaentry.c b/metaentry.c index e9d2566..50ae7b6 100644 --- a/metaentry.c +++ b/metaentry.c @@ -120,18 +120,11 @@ mentry_find(const char *path, struct metahash *mhash) static void mentry_insert(struct metaentry *mentry, struct metahash *mhash) { - struct metaentry *base; unsigned int key; key = hash(mentry->path); - if (!mhash->bucket[key]) { - mhash->bucket[key] = mentry; - return; - } - - for (base = mhash->bucket[key]; base->next; base = base->next) - /* Do nothing */; - base->next = mentry; + mentry->next = mhash->bucket[key]; + mhash->bucket[key] = mentry; } #ifdef DEBUG |