Closed dcb314 closed 7 years ago
It's not a limit check, I don't think it can lead to reading an uninitialised value, but I don't really have the time to check. Reversing the order of the tests would reduce performance, though that may be unimportant in 2017.
The libc qsort cannot be used here, as there's no realtime safe guarantees.
sifter_1210.xml:38]: (style) Array index 'left' is used before limits check.
Source code is
Suggest sanity check array index before use, not after.
Also, if the partition element is the first element, the code runs badly (Order N^2).
Looking at the bigger picture, sorting is a standard library algorithm. Suggest use standard library in preference to writing your own (buggy) code.