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

lang: Remove unnecessary clone in account exit routine #3139

Conversation

acheroncrypto
Copy link
Collaborator

Problem

There is an unnecessary clone coming from the to_account_info call in exit routine:

let info = self.to_account_info();
let mut data = info.try_borrow_mut_data()?;

Summary of changes

Directly reference self.info rather than redundantly calling self.to_account_info().

Copy link

vercel bot commented Jul 31, 2024

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added lang fix Bug fix PR performance Performance related issues/PRs labels Jul 31, 2024
This change saves ~44 CU per mutable account
@acheroncrypto acheroncrypto merged commit f6a8042 into coral-xyz:master Jul 31, 2024
49 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PR lang performance Performance related issues/PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant