comparison mercurial/cext/revlog.c @ 48766:d9a7131648a3

revlog: do not compute node location by hand in index_invalidate_added The node is not guaranteed to be at the same location all the time (e.g: changelog v2), so let's use the official existing API to get that value. Differential Revision: https://phab.mercurial-scm.org/D12176
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 11 Feb 2022 05:37:19 +0100
parents 92b5a2c4d637
children 654baf1faa52
comparison
equal deleted inserted replaced
48765:580660518459 48766:d9a7131648a3
2732 len = self->length + self->new_length; 2732 len = self->length + self->new_length;
2733 i = start - self->length; 2733 i = start - self->length;
2734 if (i < 0) 2734 if (i < 0)
2735 return; 2735 return;
2736 2736
2737 for (i = start; i < len; i++) 2737 for (i = start; i < len; i++) {
2738 nt_delete_node(&self->nt, index_deref(self, i) + 32); 2738 const char *node = index_node(self, i);
2739 nt_delete_node(&self->nt, node);
2740 }
2739 2741
2740 self->new_length = start - self->length; 2742 self->new_length = start - self->length;
2741 } 2743 }
2742 2744
2743 /* 2745 /*