Skip to content
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

no clean optimized and fast way to sort StringArray #5202

Closed
SuperUserNameMan opened this issue Jun 13, 2016 · 5 comments
Closed

no clean optimized and fast way to sort StringArray #5202

SuperUserNameMan opened this issue Jun 13, 2016 · 5 comments

Comments

@SuperUserNameMan
Copy link
Contributor

SuperUserNameMan commented Jun 13, 2016

Operating system or device - Godot version:
official 2.0.3stable win64

Issue description (what happened, and what was expected):

Currently, the only way to sort a StringArray is to convert it back into an Array to .sort() it, then convert it back to a new StringArray.

Maybe it would be more optimized to have StringArray.sort() and StringArray.sort_custom() methods ?

Steps to reproduce:
Link to minimal example project (optional but very welcome):

var very_long_list = StringArray();
var temp = Array( very_long_list );
temp.sort();
very_long_list = StringArray( temp );
@Calinou
Copy link
Member

Calinou commented Aug 15, 2019

This issue still seems to be relevant as of b030834. Only Array has sort() and sort_custom() methods, not pooled arrays. I'm not sure if adding sorting methods to pooled arrays is desirable though – there may be technical reasons as to why they don't provide sorting methods.

@kdiduk
Copy link
Contributor

kdiduk commented Oct 8, 2021

In 4.0 pooled arrays already have sort method. So this ticket is relevant only for 3.x

@Calinou
Copy link
Member

Calinou commented Oct 8, 2021

In 4.0 pooled arrays already have sort method. So this ticket is relevant only for 3.x

Indeed; this can be fixed by backporting #32144 to 3.x. Feel free to look into it if you'd like 🙂

@Calinou Calinou added this to the 3.5 milestone Oct 8, 2021
@kdiduk
Copy link
Contributor

kdiduk commented Oct 8, 2021

Indeed; this can be fixed by backporting #32144 to 3.x. Feel free to look into it if you'd like 🙂

OK, I can dig into it and see what we can do 🙂

@akien-mga
Copy link
Member

Fixed by #55650.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants