|
From: "Steve Heller" <steve@steveheller.com>
When running exactly the same test with the same data over and over, I keep getting different results, usually with a message that says "attempt to index field '?' (a nil value)", in different places in my code. If I run under the ldb debugger and inspect the data that is supposedly nil, it actually isn't.
I'm using 5.1.2. Has anyone seen this behavior before?
Thanks.
Steve
Perhaps it has something to do with this: Alen Ladavac <alenl-ml@croteam.com> wrote:
I have found the cause of this to be in the comparator function. It _must_ return false for elements that are equal, otherwise the results are just like this: either unsorted array, or array containing nils.
We had similar issues in one of our scripts a couple of months ago and it turned out that the isue was caused by comparator returning true when the first value was less or equal to the second.
HTH, Goran.