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

Improve return type of intersection2 #4389

Merged
merged 1 commit into from
May 20, 2024
Merged

Conversation

garrettjstevens
Copy link
Collaborator

I was using the intersection2 function in Apollo and realized the return type could be narrowed to [number, number] | [] instead of the inferred number[].

@garrettjstevens garrettjstevens added the enhancement New feature or request label May 17, 2024
@garrettjstevens garrettjstevens self-assigned this May 17, 2024
@cmdcolin cmdcolin merged commit 1a44d00 into main May 20, 2024
10 checks passed
@cmdcolin
Copy link
Collaborator

lgtm :)

@cmdcolin cmdcolin deleted the intersection2_return_type branch May 20, 2024 20:02
@cmdcolin
Copy link
Collaborator

random fun math note: i was just checking the logic to see whether the order of operations of the calculateDynamicBlocks if statement in the existing code matched the logic that is embedded in the intersect2 and to truly match the ops would be switched but since intersection is commutative it does not matter the order of ops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants