changeset 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 580660518459
children 654baf1faa52
files mercurial/cext/revlog.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/revlog.c	Fri Jan 28 11:54:44 2022 +0100
+++ b/mercurial/cext/revlog.c	Fri Feb 11 05:37:19 2022 +0100
@@ -2734,8 +2734,10 @@
 	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;
 }