Thread (1 message) 1 message, 1 author, 2017-09-30

Re: [PATCH Outreachy] mru: use double-linked list from list.h

From: Junio C Hamano <hidden>
Date: 2017-09-30 00:08:03

Jeff King [off-list ref] writes:
Yes, I think we could just call this "list_move_to_front()" or
something. The fact that it's operating on a list called
"packed_git_mru" is probably sufficient to make it clear that the
purpose is managing recentness.
I earlier said I wasn't sure, but I fully agree with your envisioned
endgame state, my understanding of which is that we will not have an
API that is only to be used to manage a MRU list (hence there will
be no mru.[ch] in that future), as there is very small MRU-specific
operation to be offered anyway.  Namely, mru_mark() that is to be
used to "mark the fact that the item was used---do whatever necessary
to maintain the MRU list".

Instead, everybody understands how the list API works, and the fact
that one instance of list_head is called MRU is sufficient to see
that use of "move this to the front of the list" function means we
are marking the item as most-recently-used.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help