Closed eribeiro closed 10 years ago
you get a nasty JORT_ERROR: i is less than 0 error when the array is empty or has 1 item
woops too bad :santa:
Cool. Are you running a automatic test suite that output this message?
Because if array.length = 0 or array.length = 1 the for-loop is never executed (returning the array as "sorted"). I fail to see where i variable could be less than zero in the snippet above. :jack_o_lantern:
Hi,
I am not a good JS coder (or any other kind of coder, probably). Therefore, excuse me if what I am suggesting is utterly stupid, but jortSort implementation couldn't be as below?
No need to sort the array in the first place, but I can be slipping some important detail. :)