Am 2013-09-12 14:50, schrieb Frederic Da Vitoria:

    Can someone explain what the line
      if VST.AbsoluteIndex(XNode) > -1 then
    actually means?


I didn't look at the code, but usually index = -1 means that the item was not 
found. So maybe AbsoluteIndex's result should actually be signed?

And how would it ever reach the value -1?
Obviously there is no code that sets it to this value,
otherwise it would not compile with Cardinal type.


In this example, I guess the test is to avoid a bug if AddChild does not manage 
to insert the root node. I don't know if AddChild could create a node without 
inserting, but this is what the code seems to be testing.

But it is a useless "if" statement that doesn't test anything.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to