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

Memory Usage Optimization within Solidity Structs #2 #22

Closed
wants to merge 2 commits into from

Conversation

Ansh-Agrawal1817
Copy link

Resolved #2
Removed the memory keyword in string declarations within structs. This is done to ensure that struct members persist.
Screenshot 2024-03-15 at 5 05 59 PM

@Ansh-Agrawal1817
Copy link
Author

The memory keyword indicates temporary storage that is erased after the function's execution. If your struct members are declared as memory, any changes made wouldn't persist. To ensure that struct members persist and changes are reflected in the original struct, remove the memory keyword.

@TechWizard9999
Copy link
Contributor

@Ansh-Agrawal1817
Nice!!

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.

Memory Usage Optimization within Solidity Structs
2 participants