diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-05-17 10:18:28 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-17 10:33:37 -0700 |
commit | f1782d185b03db37412f47a013400b0693fd97bd (patch) | |
tree | 26e5942668531a0ad82195cc473cd53caebbffc4 /commit-graph.c | |
parent | 71c871b48dfaf300ca20e205917db72ab9c6d7b3 (diff) |
refs: track ref stores via strmap
The refs code has two global maps that track the submodule and worktree
ref stores. Even though both of these maps track values by strings, we
still use a `struct hashmap` instead of a `struct strmap`. This has the
benefit of saving us an allocation because we can combine key and value
in a single struct. But it does introduce significant complexity that is
completely unneeded.
Refactor the code to use `struct strmap`s instead to reduce complexity.
It's unlikely that this will have any real-world impact on performance
given that most repositories likely won't have all that many ref stores.
Furthermore, this refactoring allows us to de-globalize those maps and
move them into `struct repository` in a subsequent commit more easily.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions