Re: [PATCH v2 3/6] cocci & cache.h: apply pending "index_cache_pos" rule
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 10, 2023, 19:37 UTC
- Message-ID
- <xmqq5yc9ia6p.fsf@gitster.g>
- In-Reply-To
- <patch-v2-3.6-3e9d97dbff2-20230210T102114Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> - int dst_pos = cache_name_pos(dst, strlen(dst)); > + int dst_pos = index_name_pos(&the_index, dst, > + strlen(dst));
This is not wrong per-se, but open coding what cache_name_pos() did does not reduce the reliance of the singleton default instance of the in-core index data structure.
What may have more value may be passing the pointer to an in-core index structure through the codebase, which may help more parts to be made callable as if they were library functions, but that would be a much larger task and won't belong to this "finish the conversion" topic. But doing this change will not help us to get closer to such a longer term clean-up, I am afraid.
Will queue.