Open yurivict opened 3 weeks ago
Thanks for reporting this. This particular piece of code comes from Annoy, one of our dependencies, and you should probably bring up the issue with them. I don't know this code at all, and it's basically copy/pasted into the codebase here to prevent any backwards compatibility issues.
But, looking at their code, is looks like they have this particular section as well https://github.com/spotify/annoy/blob/main/src/annoymodule.cc#L176-L184, so they would probably appreciate the bug report! And, if they fix it, I'll update the annoy code here as well to keep annoy up to date.
In C++ NULL is for a null pointer, and it isn't castable to int.
The code around this line actually doesn't make sense: it returns 0 regardless of the comparison result.