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

Add functions Array::find_first() and Array::get_first() #70727

Closed
wants to merge 1 commit into from

Conversation

matt08-prog
Copy link
Contributor

@matt08-prog matt08-prog commented Dec 30, 2022

implemented the function Array::find_custom as discussed in godotengine/godot-proposals#6006.

This is my first time making a PR for the codebase so I'm sure I missed some things. Thanks in advance.

@matt08-prog matt08-prog changed the title added array:find_custom() Add function Array::find_custom() Dec 30, 2022
@Chaosus Chaosus added this to the 4.x milestone Dec 30, 2022
Copy link
Contributor

@idbrii idbrii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Thanks for taking this on!

@Maran23
Copy link
Contributor

Maran23 commented Jan 8, 2023

Looking at the proposal, the idea is to return an element (Variant) of the Array, not an int...
And as also written in the proposal, I'm still in favor of naming it find_first/get_first, to provide the information to the caller that he will get in fact the first element, so the sort order is important.

@matt08-prog matt08-prog marked this pull request as draft January 9, 2023 10:22
@matt08-prog matt08-prog changed the title Add function Array::find_custom() Add functions Array::find_first() and Array::get_first() Jan 9, 2023
@AThousandShips
Copy link
Member

@YuriSizov YuriSizov modified the milestones: 4.x, 4.3 Oct 2, 2023
@AThousandShips AThousandShips modified the milestones: 4.3, 4.4 Jul 7, 2024
@akien-mga
Copy link
Member

Superseded by #95449. Thanks for the contribution!

@akien-mga akien-mga closed this Sep 20, 2024
@akien-mga akien-mga removed this from the 4.4 milestone Sep 20, 2024
@Radivarig
Copy link

@akien-mga This PR implements Variant get_first which was not covered by the PR it was superseded by #95449.

I was looking forward to having an array method that returns the Variant directly. Can this be reopened please?

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

Successfully merging this pull request may close these issues.

Add more array methods: first_custom, last_custom, count_custom
8 participants