# HG changeset patch # User Pierre-Yves David # Date 2022-02-11 04:37:19 # Node ID d9a7131648a35969d0128f139db760d70e9aa442 # Parent 580660518459d90c52faa0be4be4a6bcec99c6f1 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 diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c --- a/mercurial/cext/revlog.c +++ b/mercurial/cext/revlog.c @@ -2734,8 +2734,10 @@ static void index_invalidate_added(index if (i < 0) return; - for (i = start; i < len; i++) - nt_delete_node(&self->nt, index_deref(self, i) + 32); + for (i = start; i < len; i++) { + const char *node = index_node(self, i); + nt_delete_node(&self->nt, node); + } self->new_length = start - self->length; }