[Request] [+ ] D12176: revlog: do not compute node location by hand in index_invalidate_added

pacien (Pacien) phabricator at mercurial-scm.org
Mon Feb 14 18:06:44 UTC 2022


pacien created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12176

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS

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 @@
 	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;
 }



To: pacien, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20220214/a77798d6/attachment.html>


More information about the Mercurial-patches mailing list