public bool AlreadyAppeared(YamlNode a, YamlNode b, out bool identity)
{
int ai, bi;
bool ar = nodes_a.TryGetValue(a, out ai);
bool br = nodes_b.TryGetValue(b, out bi);
if ( ar && br && ai == bi ) {
identity = true;
return true;
}
if ( ar ^ br ) {
identity = false;
return true;
}
nodes_a.Add(a, nodes_a.Count);
nodes_b.Add(b, nodes_b.Count);
stack_a.Push(a);
stack_b.Push(b);
if ( a == b ) {
identity = true;
return true;
}
identity = false;
return false;
}