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

solana-ibc: avoid String allocations and multiple map lookups #40

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

mina86
Copy link
Collaborator

@mina86 mina86 commented Oct 19, 2023

Firstly, use BTreeMap::entry to avoid doing lookups in maps multiple
times. With entry method we only need to traverse the map once.

Secondly, use foo.as_str() rather than &foo.to_string() for client
and connection ids so we avoid String allocations.

Firstly, use BTreeMap::entry to avoid doing lookups in maps multiple
times.  With entry method we only need to traverse the map once.

Secondly, use `foo.as_str()` rather than `&foo.to_string()` for client
and connection ids so we avoid String allocations.
@mina86 mina86 requested a review from dhruvja October 19, 2023 14:51
@mina86 mina86 enabled auto-merge (squash) October 19, 2023 14:51
@mina86 mina86 merged commit da43fd5 into master Oct 19, 2023
4 checks passed
@mina86 mina86 deleted the mpn/d branch October 19, 2023 18:33
@blasrodri
Copy link
Contributor

@dhruvja can check it out anyways to learn

@dhruvja
Copy link
Collaborator

dhruvja commented Oct 19, 2023

@dhruvja can check it out anyways to learn

Yes yes I'm looking at it.

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

Successfully merging this pull request may close these issues.

3 participants