summaryrefslogtreecommitdiff
path: root/mru.h
diff options
context:
space:
mode:
authorLibravatar Gargi Sharma <gs051095@gmail.com>2018-01-23 18:46:51 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-01-24 09:52:16 -0800
commitec2dd32c705f43ef133a54cee99426c44eb3ab88 (patch)
tree31dbbe1fe450167adf4575f1128f3e01de7da26d /mru.h
parentmru: use double-linked list from list.h (diff)
downloadtgif-ec2dd32c705f43ef133a54cee99426c44eb3ab88.tar.xz
mru: Replace mru.[ch] with list.h implementation
Replace the custom calls to mru.[ch] with calls to list.h. This patch is the final step in removing the mru API completely and inlining the logic. This patch leads to significant code reduction and the mru API hence, is not a useful abstraction anymore. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'mru.h')
-rw-r--r--mru.h40
1 files changed, 0 insertions, 40 deletions
diff --git a/mru.h b/mru.h
deleted file mode 100644
index 80a589eb4c..0000000000
--- a/mru.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef MRU_H
-#define MRU_H
-
-#include "list.h"
-
-/**
- * A simple most-recently-used cache, backed by a doubly-linked list.
- *
- * Usage is roughly:
- *
- * // Create a list. Zero-initialization is required.
- * static struct mru cache;
- * INIT_LIST_HEAD(&cache.list);
- *
- * // Add new item to the end of the list.
- * void *item;
- * ...
- * mru_append(&cache, item);
- *
- * // Mark an item as used, moving it to the front of the list.
- * mru_mark(&cache, item);
- *
- * // Reset the list to empty, cleaning up all resources.
- * mru_clear(&cache);
- *
- * Note that you SHOULD NOT call mru_mark() and then continue traversing the
- * list; it reorders the marked item to the front of the list, and therefore
- * you will begin traversing the whole list again.
- */
-
-struct mru {
- struct list_head list;
- void *item;
-};
-
-void mru_append(struct mru *head, void *item);
-void mru_mark(struct mru *head, struct mru *entry);
-void mru_clear(struct mru *head);
-
-#endif /* MRU_H */