summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder.dev@gmail.com>2019-10-21 18:00:40 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-10-23 12:53:51 +0900
commit7cb8c929d76c12750fdece2e5da75d207938d3b9 (patch)
tree970c812bff7e89bedde466f473ef78622875774b /t
parentDocumentation: mention more worktree-specific exceptions (diff)
downloadtgif-7cb8c929d76c12750fdece2e5da75d207938d3b9.tar.xz
path.c: clarify trie_find()'s in-code comment
A fairly long comment describes trie_find()'s behavior and shows examples, but it's slightly incomplete/inaccurate. Update this comment to specify how trie_find() handles a negative return value from the given match function. Furthermore, update the list of examples to include not only two but three levels of path components. This makes the examples slightly more complicated, but it can illustrate the behavior in more corner cases. Finally, basically everything refers to the data stored for a key as "value", with two confusing exceptions: - The type definition of the match function calls its corresponding parameter 'data'. Rename that parameter to 'value'. (check_common(), the only function of this type already calls it 'value'). - The table of examples above trie_find() has a "val from node" column, which has nothing to do with the value stored in the trie: it's a "prefix of the key for which the trie contains a value" that led to that node. Rename that column header to "prefix to node". Note that neither the original nor the updated description and examples correspond 100% to the current implementation, because the implementation is a bit buggy, but the comment describes the desired behavior. The bug will be fixed in the last patch of this series. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
0 files changed, 0 insertions, 0 deletions