-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom_sort always returns errors once > 16 identical values are present in the array to be sorted #49618
Comments
Just FYI, your zip didn't upload... |
oops :/ will fix asap |
Okay, I correctly uploaded my zip now 😃 |
I can confirm the issue in (To compile on There's indeed a godot/core/templates/sort_array.h Line 57 in e312df0
But what it means and why it triggers this issue, I don't know. I checked if it could be a false positive introduced by the validation checks from #15536 (added in 3.1), but in 3.0.6 the bug seems reproducible too: <= 16 works ok, 17 triggers an error spam with errors such as these, or crashes:
|
I can confirm this still happens in 4.1.1 but in my case, this happens when there are more than 16 elements in an array, and the sort actually messes up the array previous order (but I'm guessing its because its not stable), as soon as I get the array to be lower than 16 elements it starts behaving correctly again. For the moment I implemented a TimSort and I've solved my problem. Keep up the good work. |
Godot version
3.3.2
System information
Windows 10
Issue description
Custom sorting an array of 16+ identical values returns several errors.
Even if this array is extended with other non-identical values, the issue persists.
Steps to reproduce
Basically add more than 16 identical values to an array and try to sort them.
I used this minimal code example:
Minimal reproduction project
custom_sorting_error.zip
The text was updated successfully, but these errors were encountered: