treewide: rename tree to maybe_tree

Using the commit-graph file to walk commit history removes the large
cost of parsing commits during the walk. This exposes a performance
issue: lookup_tree() takes a large portion of the computation time,
even when Git never uses those trees.

In anticipation of lazy-loading these trees, rename the 'tree' member
of struct commit to 'maybe_tree'. This serves two purposes: it hints
at the future role of possibly being NULL even if the commit has a
valid tree, and it allows for unambiguous transformation from simple
member access (i.e. commit->maybe_tree) to method access.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Derrick Stolee
2018-04-06 19:09:32 +00:00
committed by Junio C Hamano
parent 2d5792f071
commit 891435d55d
24 changed files with 65 additions and 64 deletions

View File

@ -22,7 +22,7 @@ struct commit {
unsigned int index;
timestamp_t date;
struct commit_list *parents;
struct tree *tree;
struct tree *maybe_tree;
uint32_t graph_pos;
};