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

Only need single stack for stacks #7375

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Only need single stack for stacks #7375

merged 1 commit into from
Sep 2, 2024

Conversation

benaadams
Copy link
Member

Changes

  • Only need a single Stack for stacks as they are always done in pairs so use single one
  • Using struct for Stack (that has both arrays) avoids calls to StelemRef to type check from having and Array as the generic param
  • Halves the number of operations on Stack and depth book keeping

Types of changes

What types of changes does your code introduce?

  • Optimization

Testing

Requires testing

  • No

Copy link
Contributor

@Scooletz Scooletz left a comment

Choose a reason for hiding this comment

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

Was looking at this exactly thing 😄

@benaadams benaadams merged commit 76d5fd6 into master Sep 2, 2024
66 checks passed
@benaadams benaadams deleted the stack-stacks branch September 2, 2024 09:35
{
return result;
return (result.DataStack, result.ReturnStack);
Copy link
Member

Choose a reason for hiding this comment

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

lets avoid returning new tuple here, return StackItem directly and add deconstructor to StackItem.

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.

3 participants