D3499: revlog: use node tree (native code) for shortest() calculation

Yuya Nishihara yuya at tcha.org
Thu May 10 09:08:22 EDT 2018


Looks generally good, but can you fix your editor to not do Google indent?

I'm not sure if we should bump the module version in this case, but I would
do that just for sanity.

> +static int nt_shortest(indexObject *self, const char *node)
> +{
> +  if (nt_init(self) == -1)
> +    return -3;
> +  if (nt_populate(self) == -1)
> +    return -3;
> +
> +  int level, off;

Declaration has to be moved to top.

> +  for (level = off = 0; level < 40; level++) {
> +    int k = nt_level(node, level);
> +    nodetree *n = &self->nt[off];
> +    int v = n->children[k];
> +    if (v < 0) {
> +      v = -(v + 1);
> +      const char *n = index_node(self, v);

Here, too.


More information about the Mercurial-devel mailing list