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>
This commit is contained in:

committed by
Junio C Hamano

parent
8865859dfc
commit
ec2dd32c70
@ -24,7 +24,7 @@
|
||||
#include "reachable.h"
|
||||
#include "sha1-array.h"
|
||||
#include "argv-array.h"
|
||||
#include "mru.h"
|
||||
#include "list.h"
|
||||
#include "packfile.h"
|
||||
|
||||
static const char *pack_usage[] = {
|
||||
@ -1012,9 +1012,8 @@ static int want_object_in_pack(const unsigned char *sha1,
|
||||
return want;
|
||||
}
|
||||
|
||||
list_for_each(pos, &packed_git_mru.list) {
|
||||
struct mru *entry = list_entry(pos, struct mru, list);
|
||||
struct packed_git *p = entry->item;
|
||||
list_for_each(pos, &packed_git_mru) {
|
||||
struct packed_git *p = list_entry(pos, struct packed_git, mru);
|
||||
off_t offset;
|
||||
|
||||
if (p == *found_pack)
|
||||
@ -1031,7 +1030,7 @@ static int want_object_in_pack(const unsigned char *sha1,
|
||||
}
|
||||
want = want_found_object(exclude, p);
|
||||
if (!exclude && want > 0)
|
||||
mru_mark(&packed_git_mru, entry);
|
||||
list_move(&p->mru, &packed_git_mru);
|
||||
if (want != -1)
|
||||
return want;
|
||||
}
|
||||
|
Reference in New Issue
Block a user