gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] sgf/sgfnode.c possible error


From: Paul Pogonyshev
Subject: Re: [gnugo-devel] sgf/sgfnode.c possible error
Date: Wed, 15 Sep 2004 12:04:20 -0200
User-agent: KMail/1.4.3

I wrote:

> In other words, previous node can be found like this:
>
>   if (node->parent) {
>     previous = node->parent->child;
>     while (previous->next != node)
>       previous = previous->next;
>   }

A little fix:

  if (node->parent && node->parent->child != node) {
    previous = node->parent->child;
    while (previous->next != node)
      previous = previous->next;
  }
  else
    previous = NULL;

Paul





reply via email to

[Prev in Thread] Current Thread [Next in Thread]